Fix jump problems

This commit is contained in:
Shougo Matsushita 2015-12-13 17:06:24 +09:00
parent 03e1a6ef79
commit 6866346823
2 changed files with 9 additions and 8 deletions

View File

@ -157,7 +157,8 @@ function! s:snippets_expand(cur_text, col) "{{{
\ neosnippet#helpers#get_snippets(), \ neosnippet#helpers#get_snippets(),
\ a:cur_text) \ a:cur_text)
call neosnippet#view#_expand(a:cur_text, a:col, cur_word) call neosnippet#view#_expand(
\ neosnippet#util#get_cur_text(), a:col, cur_word)
endfunction"}}} endfunction"}}}
function! s:snippets_expand_or_jump(cur_text, col) "{{{ function! s:snippets_expand_or_jump(cur_text, col) "{{{
@ -167,9 +168,9 @@ function! s:snippets_expand_or_jump(cur_text, col) "{{{
if cur_word != '' if cur_word != ''
" Found snippet trigger. " Found snippet trigger.
call neosnippet#view#_expand( call neosnippet#view#_expand(
\ a:cur_text, a:col, cur_word) \ neosnippet#util#get_cur_text(), a:col, cur_word)
else else
call neosnippet#view#_jump(a:cur_text, a:col) call neosnippet#view#_jump('', a:col)
endif endif
endfunction"}}} endfunction"}}}
@ -179,10 +180,10 @@ function! s:snippets_jump_or_expand(cur_text, col) "{{{
if search(neosnippet#get_placeholder_marker_pattern(). '\|' if search(neosnippet#get_placeholder_marker_pattern(). '\|'
\ .neosnippet#get_sync_placeholder_marker_pattern(), 'nw') > 0 \ .neosnippet#get_sync_placeholder_marker_pattern(), 'nw') > 0
" Found snippet placeholder. " Found snippet placeholder.
call neosnippet#view#_jump(a:cur_text, a:col) call neosnippet#view#_jump('', a:col)
else else
call neosnippet#view#_expand( call neosnippet#view#_expand(
\ a:cur_text, a:col, cur_word) \ neosnippet#util#get_cur_text(), a:col, cur_word)
endif endif
endfunction"}}} endfunction"}}}

View File

@ -121,7 +121,7 @@ function! neosnippet#view#_insert(snippet, options, cur_text, col) "{{{
\ }) \ })
if snip_word =~ neosnippet#get_placeholder_marker_pattern() if snip_word =~ neosnippet#get_placeholder_marker_pattern()
call neosnippet#view#_jump(a:cur_text, a:col) call neosnippet#view#_jump('', a:col)
endif endif
finally finally
if has('folding') if has('folding')
@ -133,7 +133,7 @@ function! neosnippet#view#_insert(snippet, options, cur_text, col) "{{{
endif endif
endtry endtry
endfunction"}}} endfunction"}}}
function! neosnippet#view#_jump(cur_text, col) "{{{ function! neosnippet#view#_jump(_, col) "{{{
call s:skip_next_auto_completion() call s:skip_next_auto_completion()
let expand_stack = neosnippet#variables#expand_stack() let expand_stack = neosnippet#variables#expand_stack()
@ -415,7 +415,7 @@ function! s:expand_target_placeholder(line, col) "{{{
let neosnippet.target = '' let neosnippet.target = ''
call neosnippet#view#_jump(neosnippet#util#get_cur_text(), col) call neosnippet#view#_jump('', col)
endfunction"}}} endfunction"}}}
function! s:search_sync_placeholder(start, end, number) "{{{ function! s:search_sync_placeholder(start, end, number) "{{{
if a:end == 0 if a:end == 0