From fd9d2ea81a0b0f538c3aee0658b36a35b4d6d13f Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 23 Sep 2012 14:30:02 +0900 Subject: [PATCH] - Fixed column in select mode. --- autoload/neocomplcache/sources/snippets_complete.vim | 9 ++++++++- doc/neocomplcache-snippets-complete.txt | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index 8d724c4..a900223 100644 --- a/autoload/neocomplcache/sources/snippets_complete.vim +++ b/autoload/neocomplcache/sources/snippets_complete.vim @@ -869,8 +869,15 @@ function! s:substitute_placeholder_marker(start, end, snippet_holder_cnt)"{{{ endfunction"}}} function! s:trigger(function)"{{{ let cur_text = neocomplcache#get_cur_text(1) + + let col = col('.') + if mode() !=# 'i' + " Fix column. + let col += 2 + endif + return printf("\:call %s(%s,%d)\", - \ a:function, string(cur_text), col('.')) + \ a:function, string(cur_text), col) endfunction"}}} function! s:eval_snippet(snippet_text)"{{{ let snip_word = '' diff --git a/doc/neocomplcache-snippets-complete.txt b/doc/neocomplcache-snippets-complete.txt index b2900d2..00657c0 100644 --- a/doc/neocomplcache-snippets-complete.txt +++ b/doc/neocomplcache-snippets-complete.txt @@ -310,6 +310,7 @@ CHANGELOG *neocomplcache-snippets-complete-changelog* 2012-09-23 - Fixed substitute tab character. - Improved cursor position. +- Fixed column in select mode. 2012-09-06 - Added neocomplcache__convertable attribute.