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() "{{{
|
function! SnippetsIndent() "{{{
|
||||||
let line = getline('.')
|
let line = getline('.')
|
||||||
let prev_line = (line('.') == 1)? '' : getline(line('.')-1)
|
let prev_line = (line('.') == 1)? '' : getline(line('.')-1)
|
||||||
|
let syntax = '\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\|regexp\)'
|
||||||
|
|
||||||
if prev_line =~ '^\s*$'
|
if prev_line =~ '^\s*$'
|
||||||
return 0
|
return 0
|
||||||
elseif prev_line =~ '^\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)'
|
elseif prev_line =~ '^' . syntax && line !~ '^\s*' . syntax
|
||||||
\&& line !~ '^\s*\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)'
|
|
||||||
return &shiftwidth
|
return &shiftwidth
|
||||||
else
|
else
|
||||||
return match(line, '\S')
|
return match(line, '\S')
|
||||||
|
Loading…
Reference in New Issue
Block a user