From ef3b75e87778d222d4221d8498ab823bf855a570 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 14 Mar 2014 13:51:27 +0900 Subject: [PATCH] comment_type --- autoload/emmet/lang/html.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/autoload/emmet/lang/html.vim b/autoload/emmet/lang/html.vim index 88894db..07883ce 100644 --- a/autoload/emmet/lang/html.vim +++ b/autoload/emmet/lang/html.vim @@ -346,6 +346,7 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite let indent = a:indent let dollar_expr = emmet#getResource(type, 'dollar_expr', 1) let q = emmet#getResource(type, 'quote_char', '"') + let ct = emmet#getResource(type, 'comment_type', 'both') if emmet#useFilter(filters, 'haml') return emmet#lang#haml#toString(settings, current, type, inline, filters, itemno, indent) @@ -438,7 +439,7 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite endif unlet Val endfor - if len(comment) > 0 + if len(comment) > 0 && ct == 'both' let str = "\n" . str endif if stridx(','.settings.html.empty_elements.',', ','.current_name.',') != -1 @@ -490,7 +491,11 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite let str .= "" endif if len(comment) > 0 - let str .= "\n" + if ct == "lastonly" + let str .= "" + else + let str .= "\n" + endif endif if len(current_name) > 0 && current.multiplier > 0 || stridx(','.settings.html.block_elements.',', ','.current_name.',') != -1 let str .= "\n"