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
|
return s:expand_stack
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
function! neosnippet#variables#pop_expand_stack() "{{{
|
||||||
|
let s:expand_stack = s:expand_stack[: -2]
|
||||||
|
endfunction"}}}
|
||||||
function! neosnippet#variables#clear_expand_stack() "{{{
|
function! neosnippet#variables#clear_expand_stack() "{{{
|
||||||
let s:expand_stack = []
|
let s:expand_stack = []
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
@ -167,10 +167,9 @@ function! neosnippet#view#_jump(_, col) "{{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Not found.
|
" Not found.
|
||||||
let expand_stack = neosnippet#variables#expand_stack()
|
call neosnippet#variables#pop_expand_stack()
|
||||||
let expand_stack = expand_stack[: -2]
|
|
||||||
|
|
||||||
return neosnippet#view#_search_outof_range(a:col)
|
return neosnippet#view#_jump(a:_, a:col)
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
function! s:indent_snippet(begin, end) "{{{
|
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
|
let begin = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if a:begin_line == a:end_line
|
||||||
|
return [begin, begin]
|
||||||
|
endif
|
||||||
|
|
||||||
call cursor(a:end_line, 0)
|
call cursor(a:end_line, 0)
|
||||||
if empty(a:end_patterns)
|
if empty(a:end_patterns)
|
||||||
let end = line('.') + 50
|
let end = line('.') + 50
|
||||||
|
Loading…
Reference in New Issue
Block a user