From 104a4b5ac026d6ee23b07727551911db638b26cd Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 7 May 2012 11:17:35 +0900 Subject: [PATCH] fixed character wise selection. --- autoload/zencoding.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index 611e4ce..0eee62d 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -1,7 +1,7 @@ "============================================================================= " zencoding.vim " Author: Yasuhiro Matsumoto -" Last Change: 06-May-2012. +" Last Change: 07-May-2012. let s:save_cpo = &cpo set cpo&vim @@ -805,10 +805,12 @@ function! zencoding#expandAbbr(mode) range endif let expand = substitute(expand, '\${cursor}', '$cursor$', '') let expand = substitute(expand, '\${cursor}', '', 'g') - silent! normal! gvc + silent! normal! gv + let col = col("'<") + silent! normal! c let line = getline('.') - let lhs = matchstr(line, '.*\%'.col('.').'c.') - let rhs = matchstr(line, '\%>'.col('.').'c.*') + let lhs = matchstr(line, '.*\%'.(col-1).'c.') + let rhs = matchstr(line, '\%>'.(col-1).'c.*') let expand = lhs.expand.rhs let lines = split(expand, '\n') call setline(line('.'), lines[0])