Fix #308 nested snippet problem
This commit is contained in:
parent
1d5b8589b6
commit
824c0fbe98
@ -83,6 +83,9 @@ endfunction"}}}
|
|||||||
function! neosnippet#get_placeholder_marker_substitute_pattern() "{{{
|
function! neosnippet#get_placeholder_marker_substitute_pattern() "{{{
|
||||||
return '\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}'
|
return '\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}'
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
function! neosnippet#get_placeholder_marker_substitute_nonzero_pattern() "{{{
|
||||||
|
return '\${\([1-9]\d*\%(:.\{-}\)\?\\\@<!\)}'
|
||||||
|
endfunction"}}}
|
||||||
function! neosnippet#get_placeholder_marker_default_pattern() "{{{
|
function! neosnippet#get_placeholder_marker_default_pattern() "{{{
|
||||||
return '<`\d\+:\zs.\{-}\ze\\\@<!`>'
|
return '<`\d\+:\zs.\{-}\ze\\\@<!`>'
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
@ -113,6 +113,7 @@ function! neosnippet#view#_insert(snippet, options, cur_text, col) "{{{
|
|||||||
let end_patterns = (end_line < line('$')) ?
|
let end_patterns = (end_line < line('$')) ?
|
||||||
\ [getline(end_line + 1)] : []
|
\ [getline(end_line + 1)] : []
|
||||||
call add(expand_stack, {
|
call add(expand_stack, {
|
||||||
|
\ 'snippet' : a:snippet,
|
||||||
\ 'begin_line' : begin_line,
|
\ 'begin_line' : begin_line,
|
||||||
\ 'begin_patterns' : begin_patterns,
|
\ 'begin_patterns' : begin_patterns,
|
||||||
\ 'end_line' : end_line,
|
\ 'end_line' : end_line,
|
||||||
@ -152,14 +153,17 @@ function! neosnippet#view#_jump(_, col) "{{{
|
|||||||
\ expand_info.end_patterns)
|
\ expand_info.end_patterns)
|
||||||
|
|
||||||
let begin_cnt = expand_info.holder_cnt
|
let begin_cnt = expand_info.holder_cnt
|
||||||
while (expand_info.holder_cnt - begin_cnt) < 5
|
if expand_info.snippet =~
|
||||||
" Next count.
|
\ neosnippet#get_placeholder_marker_substitute_nonzero_pattern()
|
||||||
let expand_info.holder_cnt += 1
|
while (expand_info.holder_cnt - begin_cnt) < 5
|
||||||
if neosnippet#view#_search_snippet_range(
|
" Next count.
|
||||||
\ begin, end, expand_info.holder_cnt - 1)
|
let expand_info.holder_cnt += 1
|
||||||
return 1
|
if neosnippet#view#_search_snippet_range(
|
||||||
endif
|
\ begin, end, expand_info.holder_cnt - 1)
|
||||||
endwhile
|
return 1
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
|
||||||
" Search placeholder 0.
|
" Search placeholder 0.
|
||||||
if neosnippet#view#_search_snippet_range(begin, end, 0)
|
if neosnippet#view#_search_snippet_range(begin, end, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user