From e16879217d235f7c9f28996be0ded6ba8b0c4262 Mon Sep 17 00:00:00 2001 From: mattn Date: Thu, 24 Nov 2011 14:27:16 +0900 Subject: [PATCH] wrap normaly in last tag when don't contain "*" for wrap abbreviation. --- autoload/zencoding.vim | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index fae5036..10e0315 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -346,11 +346,9 @@ function! s:zen_toString_haml(settings, current, type, inline, filters, itemno, let tmp = '' for attr in keys(current.attr) let val = current.attr[attr] - if current.multiplier > 1 - while val =~ '\$\([^#{]\|$\)' - let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') - endwhile - endif + while val =~ '\$\([^#{]\|$\)' + let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') + endwhile if attr == 'id' let str .= '#' . val elseif attr == 'class' @@ -417,11 +415,9 @@ function! s:zen_toString_html(settings, current, type, inline, filters, itemno, continue endif let val = current.attr[attr] - if current.multiplier > 1 - while val =~ '\$\([^#{]\|$\)' - let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') - endwhile - endif + while val =~ '\$\([^#{]\|$\)' + let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') + endwhile let tmp .= ' ' . attr . '="' . val . '"' if s:zen_useFilter(filters, 'c') if attr == 'id' | let comment .= '#' . val | endif @@ -688,13 +684,8 @@ function! zencoding#expandAbbr(mode) range let str .= lpart . "\n" endif endfor - if len(leader) - let items = s:zen_parseIntoTree(leader, type).child - let items[0].value = "{\n".str."}" - else - let items = s:zen_parseIntoTree(leader, type).child - let items[0].value = "{".str."}" - endif + let leader .= (str =~ "\n" ? "{\n" : "{") . str . "}" + let items = s:zen_parseIntoTree(leader, type).child else let str .= getline(a:firstline) let items = s:zen_parseIntoTree(leader, type).child