fixed problem breaking multibyte when cursor is in a part of line.

This commit is contained in:
mattn
2010-03-14 00:33:45 +09:00
parent 5e1002b3aa
commit d6c82b3f2d
2 changed files with 8 additions and 5 deletions

2
docs

Submodule docs updated: 9c62c07f1a...01d436b51f

View File

@@ -1,7 +1,7 @@
"=============================================================================
" File: zencoding.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" 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': '<c-g>u<esc>:call <sid>zen_expandAbbr(0)<cr>a'},
\ {'mode': 'i', 'var': 'user_zen_expandword_key', 'key': '.', 'plug': 'ZenCodingExpandWord', 'func': '<c-g>u<esc>:call <sid>zen_expandAbbr(1)<cr>a'},
\ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call <sid>zen_expandAbbr(2)<cr>'},
\ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call <sid>zen_expandAbbr(0)<cr>'},
\ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call <sid>zen_expandAbbr(3)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInward', 'func': '<esc>:call <sid>zen_balanceTag(0)<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInward', 'func': ':call <sid>zen_balanceTag(0)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutward', 'func': '<esc>:call <sid>zen_balanceTag(1)<cr>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