From fb31b5dbb653cee276b57bc98af802a3aeed64fd Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 2 May 2018 14:29:07 +0900 Subject: [PATCH] make child node if current node have a name already related #272 --- autoload/emmet/lang/html.vim | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/autoload/emmet/lang/html.vim b/autoload/emmet/lang/html.vim index d6d3ee3..69928fe 100644 --- a/autoload/emmet/lang/html.vim +++ b/autoload/emmet/lang/html.vim @@ -196,12 +196,28 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort for k in keys(custom_expands) if tag_name =~# k - let current.snippet = '${' . (empty(custom) ? tag_name : custom) . '}' - let current.name = '' + let snippet = '${' . (empty(custom) ? tag_name : custom) . '}' + if current.name != '' + let snode = emmet#newNode() + let snode.snippet = snippet + let snode.parent = current + let snode.multiplier = 1 + call add(current.child, snode) + else + let current.snippet = snippet + endif break elseif custom =~# k + let snippet = '${' . custom . '}' let current.snippet = '${' . custom . '}' - let current.name = '' + if current.name != '' + let snode = emmet#newNode() + let snode.snippet = snippet + let snode.parent = current + call add(current.child, snode) + else + let current.snippet = snippet + endif break endif endfor