diff options
Diffstat (limited to 'runtime/indent/haml.vim')
-rw-r--r-- | runtime/indent/haml.vim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/indent/haml.vim b/runtime/indent/haml.vim index c47a8a59c..c3935af9e 100644 --- a/runtime/indent/haml.vim +++ b/runtime/indent/haml.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Haml " Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("b:did_indent") finish @@ -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 |