Fix nested snippets behavior

This commit is contained in:
Shougo Matsushita 2015-12-19 09:09:19 +09:00
parent 05c00bfd18
commit de5a7e284d
2 changed files with 9 additions and 3 deletions

View File

@ -46,6 +46,9 @@ function! neosnippet#variables#expand_stack() "{{{
return s:expand_stack
endfunction"}}}
function! neosnippet#variables#pop_expand_stack() "{{{
let s:expand_stack = s:expand_stack[: -2]
endfunction"}}}
function! neosnippet#variables#clear_expand_stack() "{{{
let s:expand_stack = []
endfunction"}}}

View File

@ -167,10 +167,9 @@ function! neosnippet#view#_jump(_, col) "{{{
endif
" Not found.
let expand_stack = neosnippet#variables#expand_stack()
let expand_stack = expand_stack[: -2]
call neosnippet#variables#pop_expand_stack()
return neosnippet#view#_search_outof_range(a:col)
return neosnippet#view#_jump(a:_, a:col)
endfunction"}}}
function! s:indent_snippet(begin, end) "{{{
@ -229,6 +228,10 @@ function! neosnippet#view#_get_snippet_range(begin_line, begin_patterns, end_lin
let begin = 1
endif
if a:begin_line == a:end_line
return [begin, begin]
endif
call cursor(a:end_line, 0)
if empty(a:end_patterns)
let end = line('.') + 50