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(),
\ 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"}}}
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 != ''
" Found snippet trigger.
call neosnippet#view#_expand(
\ a:cur_text, a:col, cur_word)
\ neosnippet#util#get_cur_text(), a:col, cur_word)
else
call neosnippet#view#_jump(a:cur_text, a:col)
call neosnippet#view#_jump('', a:col)
endif
endfunction"}}}
@ -179,10 +180,10 @@ function! s:snippets_jump_or_expand(cur_text, col) "{{{
if search(neosnippet#get_placeholder_marker_pattern(). '\|'
\ .neosnippet#get_sync_placeholder_marker_pattern(), 'nw') > 0
" Found snippet placeholder.
call neosnippet#view#_jump(a:cur_text, a:col)
call neosnippet#view#_jump('', a:col)
else
call neosnippet#view#_expand(
\ a:cur_text, a:col, cur_word)
\ neosnippet#util#get_cur_text(), a:col, cur_word)
endif
endfunction"}}}

View File

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