Fixed SnippetsIndent()

This commit is contained in:
alpaca-tc 2014-01-05 23:18:39 +09:00
parent 001b7c65bf
commit b99c214a96
1 changed files with 2 additions and 2 deletions

View File

@ -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')