From 6e9337136581d8558bb7239a8616d61c0706e16b Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Tue, 7 Jun 2016 17:59:41 +0900 Subject: [PATCH] fixes about #303 --- autoload/emmet/lang/html.vim | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/autoload/emmet/lang/html.vim b/autoload/emmet/lang/html.vim index 59abf92..64b1e49 100644 --- a/autoload/emmet/lang/html.vim +++ b/autoload/emmet/lang/html.vim @@ -514,9 +514,23 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite if len(Val) > 0 let Val .= ' ' endif - if _val =~# '^_' - let lead = vals[0] - let Val .= lead . _val + if _val =~# '_' + if _val =~# '^_' + if has_key(current.parent.attr, 'class') + let lead = current.parent.attr["class"] + if _val =~# '^__' + let Val .= lead . _val + else + let Val .= lead . ' ' . lead . _val + endif + else + let b = split(vals[0], '_')[0] + let Val .= lead . _val + endif + else + let lead = split(vals[0], '_')[0] + let Val .= lead . ' ' . _val + endif elseif _val =~# '^-' if len(lead) == 0 let pattr = current.parent.attr