mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
no need to add cursor when has children.
This commit is contained in:
@@ -317,21 +317,25 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters,
|
|||||||
else
|
else
|
||||||
let str .= ">"
|
let str .= ">"
|
||||||
let str .= current.value[1:-2]
|
let str .= current.value[1:-2]
|
||||||
let str .= '${cursor}'
|
let nc = len(current.child)
|
||||||
for n in range(len(current.child))
|
if nc > 0
|
||||||
let child = current.child[n]
|
for n in range(nc)
|
||||||
if len(current.child) > 0 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1
|
let child = current.child[n]
|
||||||
if len(current.child) > 1 || stridx(','.settings.html.inline_elements.',', ','.child.name.',') == -1
|
if stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1
|
||||||
let str .= "\n" . indent
|
if nc > 1 || stridx(','.settings.html.inline_elements.',', ','.child.name.',') == -1
|
||||||
|
let str .= "\n" . indent
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
let inner = zencoding#toString(child, type, 0, filters)
|
||||||
let inner = zencoding#toString(child, type, 0, filters)
|
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n" . indent . '$', '', 'g')
|
||||||
let inner = substitute(inner, "\n" . indent . '$', '', 'g')
|
let str .= inner
|
||||||
let str .= inner
|
endfor
|
||||||
endfor
|
else
|
||||||
if len(current.child) > 0 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1
|
let str .= '${cursor}'
|
||||||
if len(current.child) > 1 || (len(current.child) == 1 && stridx(','.settings.html.inline_elements.',', ','.current.child[0].name.',') == -1)
|
endif
|
||||||
|
if nc > 0 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1
|
||||||
|
if nc > 1 || (nc == 1 && stridx(','.settings.html.inline_elements.',', ','.current.child[0].name.',') == -1)
|
||||||
let str .= "\n"
|
let str .= "\n"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ finish
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'query': "f div.boxes>article.box2>header>(hgroup>h2{aaa}+h3{bbb})+p{ccc}$$$$",
|
'query': "f div.boxes>article.box2>header>(hgroup>h2{aaa}+h3{bbb})+p{ccc}$$$$",
|
||||||
'result': "f <div class=\"boxes\">\n\t<article class=\"box2\">\n\t\t<header>\n\t\t\t<hgroup>\n\t\t\t\t<h2>aaa</h2>\n\t\t\t\t<h3>bbb</h3>\n\t\t\t</hgroup>\n\t\t\t<p>ccc</p>\n\t\t</header>\n\t</article>\n</div>\n",
|
'result': "f <div class=\"boxes\">\n\t<article class=\"box2\">\n\t\t<header>\n\t\t\t<hgroup>\n\t\t\t\t<h2>aaa</h2>\n\t\t\t\t<h3>bbb</h3>\n\t\t\t</hgroup>\n\t\t\t<p>ccc</p>\n\t\t</header>\n\t</article>\n</div>",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'query': "div.boxes>(div.box2>section>h2{a}+p{b})+(div.box1>section>h2{c}+p{d}+p{e}+(bq>h2{f}+h3{g})+p{h})",
|
'query': "div.boxes>(div.box2>section>h2{a}+p{b})+(div.box1>section>h2{c}+p{d}+p{e}+(bq>h2{f}+h3{g})+p{h})",
|
||||||
|
|||||||
Reference in New Issue
Block a user