Merge pull request #204 from alpaca-tc/fixed_indent_expr
Fixed SnippetsIndent()
This commit is contained in:
commit
4574119819
@ -44,11 +44,11 @@ setlocal indentexpr=SnippetsIndent()
|
||||
function! SnippetsIndent() "{{{
|
||||
let line = getline('.')
|
||||
let prev_line = (line('.') == 1)? '' : getline(line('.')-1)
|
||||
let syntax = '\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\|regexp\)'
|
||||
|
||||
if prev_line =~ '^\s*$'
|
||||
return 0
|
||||
elseif prev_line =~ '^\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)'
|
||||
\&& line !~ '^\s*\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)'
|
||||
elseif prev_line =~ '^' . syntax && line !~ '^\s*' . syntax
|
||||
return &shiftwidth
|
||||
else
|
||||
return match(line, '\S')
|
||||
|
Loading…
Reference in New Issue
Block a user