summaryrefslogtreecommitdiffstats
path: root/indent/haml.vim
diff options
context:
space:
mode:
Diffstat (limited to 'indent/haml.vim')
-rw-r--r--indent/haml.vim5
1 files changed, 3 insertions, 2 deletions
diff --git a/indent/haml.vim b/indent/haml.vim
index e6e04181..c251a4c4 100644
--- a/indent/haml.vim
+++ b/indent/haml.vim
@@ -39,10 +39,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