From 9fab173af3c5d631caa3ccc781bb48a6d0a69e59 Mon Sep 17 00:00:00 2001 From: mattn Date: Thu, 11 Mar 2010 03:05:39 +0900 Subject: [PATCH 1/6] attribute may be blank. --- zencoding.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zencoding.vim b/zencoding.vim index 4fac2aa..d6db90b 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1357,11 +1357,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 From d6c82b3f2dd362b49e4c9decee9b96ac3e790a98 Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 14 Mar 2010 00:33:45 +0900 Subject: [PATCH 2/6] 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 From 7068617f925e4e1582760b0cb8a4bc35f12a5a23 Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 14 Mar 2010 00:56:57 +0900 Subject: [PATCH 3/6] is not v. it's c! --- zencoding.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zencoding.vim b/zencoding.vim index 40a84fe..394058b 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1300,7 +1300,7 @@ function! s:zen_expandAbbr(mode) range else let line = getline('.') if col('.') < len(line) - let line = matchstr(line, '^\(.*\%'.col('.').'v.\)') + let line = matchstr(line, '^\(.*\%'.col('.').'c.\)') endif if a:mode == 1 || type != 'html' let part = matchstr(line, '\([a-zA-Z0-9_\@:|]\+\)$') From 21b5d07790416ee3c317f56e7149986ad794abcd Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 14 Mar 2010 01:05:48 +0900 Subject: [PATCH 4/6] use original indent instead of s:zen_settings.indentation for start of the line. --- zencoding.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zencoding.vim b/zencoding.vim index 394058b..148bb28 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1337,8 +1337,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 From a8ce3841d6f3fcde1b0dd28124c5036d24f1f78d Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 14 Mar 2010 01:27:28 +0900 Subject: [PATCH 5/6] 12px --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 01d436b..8fc38a5 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 01d436b51f141d062c570db81021869541ad5547 +Subproject commit 8fc38a5dfba97dee2612b9c5f11e3f6053668415 From e212a6a696e305cfa2358f94dc5a1003353d3ad4 Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 14 Mar 2010 02:45:53 +0900 Subject: [PATCH 6/6] version++ --- docs | 2 +- zencoding.vim | 2 +- zencoding.vim.vimup | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs b/docs index 8fc38a5..62068bb 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 8fc38a5dfba97dee2612b9c5f11e3f6053668415 +Subproject commit 62068bb21dd957d95ac63c7c25005e1ecd694608 diff --git a/zencoding.vim b/zencoding.vim index 148bb28..b63968b 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -2,7 +2,7 @@ " File: zencoding.vim " Author: Yasuhiro Matsumoto " Last Change: 14-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/ 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': |