From 16a09f81c1822edf53a6f247595416f99fd22bff Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 25 Nov 2011 22:28:45 +0900 Subject: [PATCH] attribute index like node[attr$] --- autoload/zencoding.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index 8c0ed83..c0227f6 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -367,6 +367,7 @@ function! s:zen_toString_haml(settings, current, type, inline, filters, itemno, while val =~ '\$\([^#{]\|$\)' let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') endwhile + let attr = substitute(attr, '\$$', itemno+1, '') if attr == 'id' let str .= '#' . val elseif attr == 'class' @@ -440,6 +441,7 @@ function! s:zen_toString_html(settings, current, type, inline, filters, itemno, while val =~ '\$\([^#{]\|$\)' let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') endwhile + let attr = substitute(attr, '\$$', itemno+1, '') let tmp .= ' ' . attr . '="' . val . '"' if s:zen_useFilter(filters, 'c') if attr == 'id' | let comment .= '#' . val | endif @@ -761,6 +763,7 @@ function! zencoding#expandAbbr(mode) range for item in items let expand .= s:zen_toString(item, type, 0, filters) endfor + let expand = substitute(expand, '\$line\([0-9]\+\)\$', '\=submatch(1)', 'g') endif if len(expand) if expand !~ '\${cursor}'