mirror of
https://github.com/tpope/vim-haml.git
synced 2025-12-07 17:54:29 +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
|
||||
|
||||
Reference in New Issue
Block a user