mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 19:24:27 +08:00
fix indent. multiple $$$ problem.
This commit is contained in:
@@ -1065,10 +1065,10 @@ function! s:zen_toString(...)
|
|||||||
let tmp = '<' . current.name
|
let tmp = '<' . current.name
|
||||||
for attr in keys(current.attr)
|
for attr in keys(current.attr)
|
||||||
let val = current.attr[attr]
|
let val = current.attr[attr]
|
||||||
if current.multiplier > 1 && val =~ '\$$'
|
if current.multiplier > 1
|
||||||
let doller = substitute(val, '^.\{-}\(\$\+\)$', '\1', '')
|
while val =~ '\$[^{]*'
|
||||||
let val = substitute(val, '\(\$\+\)$', '', '')
|
let val = substitute(val, '\(\$\+\)\([^{]*\)', '\=printf("%0".len(submatch(1))."d", m+1).submatch(2)', 'g')
|
||||||
let val .= printf('%0' . len(doller) . 'd', m+1)
|
endwhile
|
||||||
endif
|
endif
|
||||||
let tmp .= ' ' . attr . '="' . val . '"'
|
let tmp .= ' ' . attr . '="' . val . '"'
|
||||||
if filter == 'c'
|
if filter == 'c'
|
||||||
@@ -1136,10 +1136,10 @@ function! s:zen_toString(...)
|
|||||||
let tmp = ''
|
let tmp = ''
|
||||||
for attr in keys(current.attr)
|
for attr in keys(current.attr)
|
||||||
let val = current.attr[attr]
|
let val = current.attr[attr]
|
||||||
if current.multiplier > 1 && val =~ '\$$'
|
if current.multiplier > 1
|
||||||
let doller = substitute(val, '^.\{-}\(\$\+\)$', '\1', '')
|
while val =~ '\$[^{]*'
|
||||||
let val = substitute(val, '\(\$\+\)$', '', '')
|
let val = substitute(val, '\(\$\+\)\([^{]*\)', '\=printf("%0".len(submatch(1))."d", m+1).submatch(2)', 'g')
|
||||||
let val .= printf('%0' . len(doller) . 'd', m+1)
|
endwhile
|
||||||
endif
|
endif
|
||||||
if attr == 'id'
|
if attr == 'id'
|
||||||
let str .= '#' . val
|
let str .= '#' . val
|
||||||
@@ -1327,8 +1327,8 @@ function! s:zen_expandAbbr(mode) range
|
|||||||
let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g')
|
let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g')
|
||||||
endif
|
endif
|
||||||
if line[:-len(part)-1] =~ '^\s\+$'
|
if line[:-len(part)-1] =~ '^\s\+$'
|
||||||
let size = len(line) - len(part)
|
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] . repeat(s:zen_settings.indentation, size)
|
||||||
else
|
else
|
||||||
let indent = ''
|
let indent = ''
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user