From 1a9b7d2805a63cdd7fdf1bc90ff1dd04093823f6 Mon Sep 17 00:00:00 2001 From: mattn Date: Wed, 6 Jun 2012 12:09:49 +0900 Subject: [PATCH] check top level node or not. close #80 --- autoload/zencoding/lang/html.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/zencoding/lang/html.vim b/autoload/zencoding/lang/html.vim index 74b751a..643dd7f 100644 --- a/autoload/zencoding/lang/html.vim +++ b/autoload/zencoding/lang/html.vim @@ -296,7 +296,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters, let current_name = current.name let current_name = substitute(current.name, '\$$', itemno+1, '') - if len(current.parent.name) > 0 && current.multiplier > 0 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1 + if !empty(current.parent) && len(current.parent.name) > 0 && current.multiplier > 0 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1 if current.parent.multiplier > 0 let str .= "\n" endif @@ -376,7 +376,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters, endif endif - if len(current.parent.name) == 0 || (current.multiplier > 0 && current.multiplier == itemno+1 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1) + if !empty(current.parent) && len(current.parent.name) == 0 || (current.multiplier > 0 && current.multiplier == itemno+1 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1) let str .= "\n" endif