Fix nested snippets behavior
This commit is contained in:
parent
05c00bfd18
commit
de5a7e284d
@ -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"}}}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user