From 6866346823bfddebb68a05cd76645f64025b1fca Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 13 Dec 2015 17:06:24 +0900 Subject: [PATCH] Fix jump problems --- autoload/neosnippet/mappings.vim | 11 ++++++----- autoload/neosnippet/view.vim | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/autoload/neosnippet/mappings.vim b/autoload/neosnippet/mappings.vim index 02e760e..8c25b0c 100644 --- a/autoload/neosnippet/mappings.vim +++ b/autoload/neosnippet/mappings.vim @@ -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"}}} diff --git a/autoload/neosnippet/view.vim b/autoload/neosnippet/view.vim index fa41937..e0a700a 100644 --- a/autoload/neosnippet/view.vim +++ b/autoload/neosnippet/view.vim @@ -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