diff --git a/docs b/docs index 9c62c07..62068bb 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 9c62c07f1ab45d71a3c3f64694501a696319bb50 +Subproject commit 62068bb21dd957d95ac63c7c25005e1ecd694608 diff --git a/zencoding.vim b/zencoding.vim index 4a54096..4bb4dbd 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -2,7 +2,7 @@ " File: zencoding.vim " Author: Yasuhiro Matsumoto " Last Change: 15-Mar-2010. -" Version: 0.32 +" Version: 0.33 " WebPage: http://github.com/mattn/zencoding-vim " Description: vim plugins for HTML and CSS hi-speed coding. " SeeAlso: http://code.google.com/p/zen-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'}, @@ -1324,13 +1324,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('.').'c.\)') + endif if a:mode == 1 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*,\{0,1}\s*\)*$' if str =~ mx @@ -1360,8 +1363,7 @@ function! s:zen_expandAbbr(mode) range let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g') endif if line[:-len(part)-1] =~ '^\s\+$' - let size = (len(line) - len(part)) / len(s:zen_settings.indentation) - let indent = repeat(s:zen_settings.indentation, size) + let indent = line[:-len(part)-1] else let indent = '' endif @@ -1390,11 +1392,11 @@ endfunction function! s:zen_parseTag(tag) let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 } - let mx = '<\([a-zA-Z][a-zA-Z0-9]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|["''][^"'']\+["'']\)\s*\)*\)\(/\{0,1}\)>' + let mx = '<\([a-zA-Z][a-zA-Z0-9]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|["''][^"'']*["'']\)\s*\)*\)\(/\{0,1}\)>' let match = matchstr(a:tag, mx) let current.name = substitute(match, mx, '\1', 'i') let attrs = substitute(match, mx, '\2', 'i') - let mx = '\([a-zA-Z0-9]\+\)=["'']\{0,1}\([^"'' \t]\+\|[^"'']\+\)["'']\{0,1}' + let mx = '\([a-zA-Z0-9]\+\)=["'']\{0,1}\([^"'' \t]*\|[^"'']\+\)["'']\{0,1}' while len(attrs) > 0 let match = matchstr(attrs, mx) if len(match) == 0 diff --git a/zencoding.vim.vimup b/zencoding.vim.vimup index e43d38b..a7a14b6 100644 --- a/zencoding.vim.vimup +++ b/zencoding.vim.vimup @@ -2,7 +2,7 @@ script_name: ZenCoding.vim script_id: '2981' script_type: utility script_package: zencoding.vim -script_version: '0.32' +script_version: '0.33' required_vim_version: '7.0' summary: vim plugins for HTML and CSS hi-speed coding. @@ -81,6 +81,8 @@ install_details: | copy zencoding.vim to your plugin directory. versions: +- '0.33': | + This is an upgrade for ZenCoding.vim: fixed problem breaking multibyte when cursor is in a part of line. enabled zencoding for javascript in html. - '0.32': | This is an upgrade for ZenCoding.vim: fixed indentation. supported extends so that you can enable zencoding for php/xhtml/haml other's section 14 in http://github.com/mattn/zencoding-vim/raw/master/TUTORIAL - '0.31': |