From b61feb2f7696039b9a8bacb719b99d5933f69278 Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 11 Jun 2012 20:02:12 +0900 Subject: [PATCH] why call in several time. --- autoload/zencoding.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index 480f524..4cb93e3 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -236,16 +236,17 @@ function! zencoding#getFileType() let type = &ft endif if type == 'html' - if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css' + let type = synIDattr(synID(line("."), col("."), 1), "name") + if type =~ '^css\w' let type = 'css' endif - if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html' + if type =~ '^html\w' let type = 'html' endif - if synIDattr(synID(line("."), col("."), 1), "name") =~ '^javaScript' + if type =~ '^javaScript' let type = 'javascript' endif - if len(type) == 0 && synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml' + if len(type) == 0 && type =~ '^xml' let type = 'xml' endif endif