mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-08 11:34:46 +08:00
attribute index like node[attr$]
This commit is contained in:
@@ -367,6 +367,7 @@ function! s:zen_toString_haml(settings, current, type, inline, filters, itemno,
|
|||||||
while val =~ '\$\([^#{]\|$\)'
|
while val =~ '\$\([^#{]\|$\)'
|
||||||
let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
endwhile
|
endwhile
|
||||||
|
let attr = substitute(attr, '\$$', itemno+1, '')
|
||||||
if attr == 'id'
|
if attr == 'id'
|
||||||
let str .= '#' . val
|
let str .= '#' . val
|
||||||
elseif attr == 'class'
|
elseif attr == 'class'
|
||||||
@@ -440,6 +441,7 @@ function! s:zen_toString_html(settings, current, type, inline, filters, itemno,
|
|||||||
while val =~ '\$\([^#{]\|$\)'
|
while val =~ '\$\([^#{]\|$\)'
|
||||||
let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
|
||||||
endwhile
|
endwhile
|
||||||
|
let attr = substitute(attr, '\$$', itemno+1, '')
|
||||||
let tmp .= ' ' . attr . '="' . val . '"'
|
let tmp .= ' ' . attr . '="' . val . '"'
|
||||||
if s:zen_useFilter(filters, 'c')
|
if s:zen_useFilter(filters, 'c')
|
||||||
if attr == 'id' | let comment .= '#' . val | endif
|
if attr == 'id' | let comment .= '#' . val | endif
|
||||||
@@ -761,6 +763,7 @@ function! zencoding#expandAbbr(mode) range
|
|||||||
for item in items
|
for item in items
|
||||||
let expand .= s:zen_toString(item, type, 0, filters)
|
let expand .= s:zen_toString(item, type, 0, filters)
|
||||||
endfor
|
endfor
|
||||||
|
let expand = substitute(expand, '\$line\([0-9]\+\)\$', '\=submatch(1)', 'g')
|
||||||
endif
|
endif
|
||||||
if len(expand)
|
if len(expand)
|
||||||
if expand !~ '\${cursor}'
|
if expand !~ '\${cursor}'
|
||||||
|
|||||||
Reference in New Issue
Block a user