From b898dd9a9bf9b634a303959b432ce1c1da53bc63 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Wed, 30 Jul 2014 20:19:09 +0900 Subject: [PATCH] Fix #237 expand trigger problem --- autoload/neosnippet/mappings.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/autoload/neosnippet/mappings.vim b/autoload/neosnippet/mappings.vim index fe55486..9d00d74 100644 --- a/autoload/neosnippet/mappings.vim +++ b/autoload/neosnippet/mappings.vim @@ -119,8 +119,14 @@ function! neosnippet#mappings#_expand_target_trigger(trigger) "{{{ call cursor(line, col) - call neosnippet#view#_expand( - \ neosnippet#util#get_cur_text(). ' ', col, a:trigger) + if col == 1 + let cur_text = a:trigger + else + let cur_text = neosnippet#util#get_cur_text() + let cur_text = cur_text[: col-2] . a:trigger . cur_text[col :] + endif + + call neosnippet#view#_expand(cur_text, col, a:trigger) endfunction"}}} function! s:snippets_expand(cur_text, col) "{{{