From d6c82b3f2dd362b49e4c9decee9b96ac3e790a98 Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 14 Mar 2010 00:33:45 +0900 Subject: [PATCH] fixed problem breaking multibyte when cursor is in a part of line. --- docs | 2 +- zencoding.vim | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs b/docs index 9c62c07..01d436b 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 9c62c07f1ab45d71a3c3f64694501a696319bb50 +Subproject commit 01d436b51f141d062c570db81021869541ad5547 diff --git a/zencoding.vim b/zencoding.vim index 5dff0ee..40a84fe 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1,7 +1,7 @@ "============================================================================= " File: zencoding.vim " Author: Yasuhiro Matsumoto -" Last Change: 12-Mar-2010. +" Last Change: 14-Mar-2010. " Version: 0.32 " WebPage: http://github.com/mattn/zencoding-vim " Description: vim plugins for HTML and CSS hi-speed coding. @@ -83,7 +83,7 @@ for item in [ \ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': 'u:call zen_expandAbbr(0)a'}, \ {'mode': 'i', 'var': 'user_zen_expandword_key', 'key': '.', 'plug': 'ZenCodingExpandWord', 'func': 'u:call zen_expandAbbr(1)a'}, \ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call zen_expandAbbr(2)'}, -\ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call zen_expandAbbr(0)'}, +\ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call zen_expandAbbr(3)'}, \ {'mode': 'i', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInward', 'func': ':call zen_balanceTag(0)a'}, \ {'mode': 'n', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInward', 'func': ':call zen_balanceTag(0)'}, \ {'mode': 'i', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutward', 'func': ':call zen_balanceTag(1)a'}, @@ -1298,13 +1298,16 @@ function! s:zen_expandAbbr(mode) range endif silent! exe "normal! gvc" else - let line = getline('.')[:col('.')] + let line = getline('.') + if col('.') < len(line) + let line = matchstr(line, '^\(.*\%'.col('.').'v.\)') + endif if a:mode == 1 || type != 'html' let part = matchstr(line, '\([a-zA-Z0-9_\@:|]\+\)$') else let part = matchstr(line, '\(\S.*\)$') endif - let rest = getline('.')[col('.')+1:] + let rest = getline('.')[len(line):] let str = part let mx = '|\(html\|haml\|e\|c\|fc\|xsl\)\s*$' if str =~ mx