Merge pull request #57 from vinsonchuong/refactor-folding-fix

Simplify folding fix
This commit is contained in:
Shougo 2012-10-25 22:59:58 -07:00
commit dcef469919
1 changed files with 4 additions and 10 deletions

View File

@ -549,11 +549,6 @@ function! neosnippet#expand(cur_text, col, trigger_name)"{{{
\ '<|\1|>', 'g')
" Insert snippets.
if has('folding')
let foldmethod = &l:foldmethod
let &l:foldmethod = 'manual'
endif
let next_line = getline('.')[a:col-1 :]
let snippet_lines = split(snip_word, '\n', 1)
if empty(snippet_lines)
@ -572,6 +567,10 @@ function! neosnippet#expand(cur_text, col, trigger_name)"{{{
call append('.', snippet_lines[1:])
endif
if has('folding')
silent! execute begin_line . ',' . end_line . 'foldopen!'
endif
call s:indent_snippet(begin_line, end_line)
let begin_patterns = (begin_line > 1) ?
@ -592,11 +591,6 @@ function! neosnippet#expand(cur_text, col, trigger_name)"{{{
startinsert!
endif
if has('folding')
let &l:foldmethod = foldmethod
silent execute begin_line . ',' . end_line . 'foldopen!'
endif
if snip_word =~ s:get_placeholder_marker_pattern()
call s:snippets_jump(a:cur_text, a:col)
endif