mirror of
https://github.com/tpope/vim-haml.git
synced 2025-12-07 01:34:25 +08:00
Use shiftwidth() when available
Closes https://github.com/tpope/vim-haml/issues/76
This commit is contained in:
@@ -37,10 +37,11 @@ function! GetHamlIndent()
|
||||
let line = substitute(line,'^\s\+','','')
|
||||
let indent = indent(lnum)
|
||||
let cindent = indent(v:lnum)
|
||||
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
||||
if cline =~# '\v^-\s*%(elsif|else|when)>'
|
||||
let indent = cindent < indent ? cindent : indent - &sw
|
||||
let indent = cindent < indent ? cindent : indent - sw
|
||||
endif
|
||||
let increase = indent + &sw
|
||||
let increase = indent + sw
|
||||
if indent == indent(lnum)
|
||||
let indent = cindent <= indent ? -1 : increase
|
||||
endif
|
||||
|
||||
@@ -29,7 +29,7 @@ function! GetSassIndent()
|
||||
let indent = indent(lnum)
|
||||
let cindent = indent(v:lnum)
|
||||
if line !~ s:property && line !~ s:extend && cline =~ s:property
|
||||
return indent + &sw
|
||||
return indent + (exists('*shiftwidth') ? shiftwidth() : &sw)
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user