mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 10:44:24 +08:00
Fixes #329 again
This commit is contained in:
@@ -332,6 +332,7 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
if operator =~# '>'
|
if operator =~# '>'
|
||||||
let last.pos += 1
|
let last.pos += 1
|
||||||
endif
|
endif
|
||||||
|
let last.block = 1
|
||||||
for n in range(len(block_start))
|
for n in range(len(block_start))
|
||||||
let pos += [last.pos]
|
let pos += [last.pos]
|
||||||
endfor
|
endfor
|
||||||
@@ -353,10 +354,15 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
let last = parent
|
let last = parent
|
||||||
let last.pos += 1
|
let last.pos += 1
|
||||||
endif
|
endif
|
||||||
elseif n =~ '^*[0-9]\+$'
|
|
||||||
let last.child[-1].multiplier = 0 + n[1:]
|
|
||||||
elseif len(n)
|
elseif len(n)
|
||||||
let cl = last.child
|
let start = 0
|
||||||
|
for nc in range(len(last.child))
|
||||||
|
if has_key(last.child[nc], 'block')
|
||||||
|
let start = nc
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
let cl = last.child[nc:]
|
||||||
let cls = []
|
let cls = []
|
||||||
for c in range(n[1:])
|
for c in range(n[1:])
|
||||||
for cc in cl
|
for cc in cl
|
||||||
@@ -368,8 +374,12 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
endfor
|
endfor
|
||||||
let cls += deepcopy(cl)
|
let cls += deepcopy(cl)
|
||||||
endfor
|
endfor
|
||||||
|
if nc > 0
|
||||||
|
let last.child = last.child[:nc-1] + cls
|
||||||
|
else
|
||||||
let last.child = cls
|
let last.child = cls
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
let abbr = abbr[stridx(abbr, match) + len(match):]
|
let abbr = abbr[stridx(abbr, match) + len(match):]
|
||||||
|
|||||||
@@ -542,8 +542,7 @@ finish
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'query': "form>fieldset>legend+(label>input[type=\"checkbox\"])*3",
|
'query': "form>fieldset>legend+(label>input[type=\"checkbox\"])*3",
|
||||||
'result': "<form action=\"\">\t<fieldset>\t\t<legend></legend>\t\t<label for=\"\"><input type=\"checkbox\"></label>\t\t<label for=\"\"><input type=\"checkbox\"></label>\t\t<label for=\"\"><input type=\"checkbox\"></label>\t</fieldset></form>",
|
'result': "<form action=\"\">\n\t<fieldset>\n\t\t<legend></legend>\n\t\t<label for=\"\"><input type=\"checkbox\"></label>\n\t\t<label for=\"\"><input type=\"checkbox\"></label>\n\t\t<label for=\"\"><input type=\"checkbox\"></label>\n\t</fieldset>\n</form>\n",
|
||||||
'ignore': 1,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user