From 915726a88db75a454b634304ef0387c0d9cd4095 Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 10 Jun 2012 02:11:16 +0900 Subject: [PATCH] fix indent for wrap with abbreviation. --- autoload/zencoding/lang/html.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/zencoding/lang/html.vim b/autoload/zencoding/lang/html.vim index 3291546..46bee05 100644 --- a/autoload/zencoding/lang/html.vim +++ b/autoload/zencoding/lang/html.vim @@ -321,8 +321,8 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters, if nc > 0 for n in range(nc) let child = current.child[n] - if stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1 - if nc > 1 || stridx(','.settings.html.inline_elements.',', ','.child.name.',') == -1 + if len(current_name) > 0 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1 + if nc > 1 || (len(child.name) > 0 && stridx(','.settings.html.inline_elements.',', ','.child.name.',') == -1) let str .= "\n" . indent endif endif @@ -335,7 +335,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters, let str .= '${cursor}' 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) + if nc > 1 || (nc == 1 && len(current.child[0].name) > 0 && stridx(','.settings.html.inline_elements.',', ','.current.child[0].name.',') == -1) let str .= "\n" endif endif @@ -344,7 +344,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters, if len(comment) > 0 let str .= "\n" endif - if (current.multiplier > 0 && !empty(current.parent) && len(current.parent.child) > 1)|| stridx(','.settings.html.block_elements.',', ','.current_name.',') != -1 + if len(current_name) > 0 && (current.multiplier > 0 && !empty(current.parent) && len(current.parent.child) > 1)|| stridx(','.settings.html.block_elements.',', ','.current_name.',') != -1 let str .= "\n" endif return str