From 870db7dfcae23077b43f5a044f70ab05ab389985 Mon Sep 17 00:00:00 2001 From: Vinson Chuong Date: Sat, 27 Oct 2012 17:03:56 -0700 Subject: [PATCH] Simplified fix not working for some snippets --- autoload/neosnippet.vim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index fcbf9bd..d6e21a0 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -552,15 +552,16 @@ function! neosnippet#expand(cur_text, col, trigger_name)"{{{ let next_col = len(snippet_lines[-1]) + 1 let snippet_lines[-1] = snippet_lines[-1] . next_line + if has('folding') + let foldmethod = &l:foldmethod + let &l:foldmethod = 'manual' + endif + call setline('.', snippet_lines[0]) if len(snippet_lines) > 1 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) ? @@ -585,6 +586,10 @@ function! neosnippet#expand(cur_text, col, trigger_name)"{{{ call s:snippets_jump(a:cur_text, a:col) endif + if has('folding') + let &l:foldmethod = foldmethod + silent! execute begin_line . ',' . end_line . 'foldopen!' + endif let &l:iminsert = 0 let &l:imsearch = 0 endfunction"}}}