diff --git a/zencoding.vim b/zencoding.vim index e2412ae..b1870b7 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1,7 +1,7 @@ "============================================================================= " File: zencoding.vim " Author: Yasuhiro Matsumoto -" Last Change: 16-Mar-2010. +" Last Change: 17-Mar-2010. " Version: 0.35 " WebPage: http://github.com/mattn/zencoding-vim " Description: vim plugins for HTML and CSS hi-speed coding. @@ -1198,7 +1198,9 @@ function! s:zen_toString(...) if attr == 'class' | let comment .= '.' . val | endif endif endfor - if len(comment) > 0 | let tmp = "\n" . comment_indent . tmp | endif + if len(comment) > 0 + let tmp = "" . (inline ? "" : "\n") . comment_indent . tmp + endif let str .= tmp let inner = current.value[1:-2] if stridx(','.s:zen_settings.html.inline_elements.',', ','.current.name.',') != -1 @@ -1231,7 +1233,6 @@ function! s:zen_toString(...) else let str .= ">" . inner . "" endif - if len(comment) > 0 | let str .= "\n" . comment_indent | endif else if inline == 0 if stridx(','.s:zen_settings.html.empty_elements.',', ','.current.name.',') != -1 @@ -1243,7 +1244,6 @@ function! s:zen_toString(...) let str .= ">" . inner . '${cursor}\n" endif endif - if len(comment) > 0 | let str .= "\n" . comment_indent | endif else if stridx(','.s:zen_settings.html.empty_elements.',', ','.current.name.',') != -1 let str .= " />" @@ -1252,6 +1252,9 @@ function! s:zen_toString(...) endif endif endif + if len(comment) > 0 + let str .= "" . (inline ? "" : "\n") . comment_indent + endif else if len(current.snippet) > 0 let tmp = substitute(current.snippet, '|', '${cursor}', 'g')