mirror of
https://github.com/tpope/vim-haml.git
synced 2026-03-05 17:44:16 +08:00
Don't try to indent properties that follow mixins
This commit is contained in:
@@ -17,7 +17,8 @@ if exists("*GetSassIndent")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:property = '^\s*:\|^\s*[[:alnum:]-]\+\%(:\|\s*=\)'
|
let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)'
|
||||||
|
let s:extend = '^\s*\%(@extend\|+\)'
|
||||||
|
|
||||||
function! GetSassIndent()
|
function! GetSassIndent()
|
||||||
let lnum = prevnonblank(v:lnum-1)
|
let lnum = prevnonblank(v:lnum-1)
|
||||||
@@ -27,7 +28,7 @@ function! GetSassIndent()
|
|||||||
let line = substitute(line,'^\s\+','','')
|
let line = substitute(line,'^\s\+','','')
|
||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
let cindent = indent(v:lnum)
|
let cindent = indent(v:lnum)
|
||||||
if line !~ s:property && cline =~ s:property
|
if line !~ s:property && line !~ s:extend && cline =~ s:property
|
||||||
return indent + &sw
|
return indent + &sw
|
||||||
"elseif line =~ s:property && cline !~ s:property
|
"elseif line =~ s:property && cline !~ s:property
|
||||||
"return indent - &sw
|
"return indent - &sw
|
||||||
|
|||||||
Reference in New Issue
Block a user