diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index ca06d83..1fa59d9 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -1,7 +1,7 @@ "============================================================================= " zencoding.vim " Author: Yasuhiro Matsumoto -" Last Change: 12-Oct-2011. +" Last Change: 14-Oct-2011. let s:save_cpo = &cpo set cpo&vim @@ -335,7 +335,7 @@ function! s:zen_toString_haml(settings, current, type, inline, filters, itemno, for attr in keys(current.attr) let val = current.attr[attr] if current.multiplier > 1 - while val =~ '\$\([^{]\|$\)' + while val =~ '\$\([^#{]\|$\)' let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') endwhile endif @@ -404,7 +404,7 @@ function! s:zen_toString_html(settings, current, type, inline, filters, itemno, endif let val = current.attr[attr] if current.multiplier > 1 - while val =~ '\$\([^{]\|$\)' + while val =~ '\$\([^#{]\|$\)' let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') endwhile endif @@ -513,13 +513,18 @@ function! s:zen_toString(...) let str = '' while itemno < current.multiplier if len(current.name) + let inner = '' if exists('*g:zen_toString_'.type) - let str .= function('g:zen_toString_'.type)(s:zen_settings, current, type, inline, filters, itemno, indent) + let inner = function('g:zen_toString_'.type)(s:zen_settings, current, type, inline, filters, itemno, indent) elseif s:zen_useFilter(filters, 'haml') - let str .= s:zen_toString_haml(s:zen_settings, current, type, inline, filters, itemno, indent) + let inner = s:zen_toString_haml(s:zen_settings, current, type, inline, filters, itemno, indent) else - let str .= s:zen_toString_html(s:zen_settings, current, type, inline, filters, itemno, indent) + let inner = s:zen_toString_html(s:zen_settings, current, type, inline, filters, itemno, indent) endif + if current.multiplier > 1 + let inner = substitute(inner, '\$#', '$line'.(itemno+1).'$', 'g') + endif + let str .= inner else let snippet = current.snippet if len(current.snippet) == 0 @@ -637,7 +642,10 @@ function! zencoding#expandAbbr(mode) range let leader = substitute(leader, mx, '', '') endif if leader =~ '\*' - let query = substitute(leader, '*', '*' . (a:lastline - a:firstline + 1), '') . '>{$line$}' + let query = substitute(leader, '*', '*' . (a:lastline - a:firstline + 1), '') + if query !~ '}\s*$' + let query .= '>{$#}' + endif let items = s:zen_parseIntoTree(query, type).child for item in items let expand .= s:zen_toString(item, type, 0, filters) @@ -647,12 +655,9 @@ function! zencoding#expandAbbr(mode) range for n in range(a:firstline, a:lastline) let lline = getline(n) let lpart = substitute(lline, '^\s*', '', '') - let pos = stridx(expand, "$line$") - if pos != -1 - let expand = expand[:pos-1] . lpart . expand[pos+6:] - endif + let expand = substitute(expand, '\$line'.(n-a:firstline+1).'\$', lpart, 'g') endfor - let expand = substitute(expand, '\$line\$', '', 'g') + let expand = substitute(expand, '\$line\d*\$', '', 'g') else let str = '' if a:firstline != a:lastline diff --git a/plugin/zencoding.vim b/plugin/zencoding.vim index 99591f4..3757aa6 100644 --- a/plugin/zencoding.vim +++ b/plugin/zencoding.vim @@ -1,8 +1,8 @@ "============================================================================= " File: zencoding.vim " Author: Yasuhiro Matsumoto -" Last Change: 26-Sep-2011. -" Version: 0.54 +" Last Change: 22-Oct-2011. +" Version: 0.55 " 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 fe6434b..a5b133b 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.zip -script_version: '0.54' +script_version: '0.55' required_vim_version: '7.0' summary: vim plugins for HTML and CSS hi-speed coding. @@ -98,6 +98,8 @@ install_details: | # git clone http://github.com/mattn/zencoding-vim.git versions: +- '0.55': | + uploaded again: sorry, files was old. - '0.54': | [add] support sass, xsd. [fix] expanding with html tag.