From 5649d73104251803be592fbf8a47c88ae5214243 Mon Sep 17 00:00:00 2001 From: Phil Booth Date: Fri, 31 May 2013 13:55:33 +0100 Subject: [PATCH] Ignore HTML multi-line comments. --- plugin/detectindent.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/detectindent.vim b/plugin/detectindent.vim index 4801de1..9b3605b 100644 --- a/plugin/detectindent.vim +++ b/plugin/detectindent.vim @@ -32,13 +32,17 @@ fun! HasCStyleComments() return index(["c", "cpp", "java", "javascript", "php"], &ft) != -1 endfun +fun! HasHTMLStyleComments() + return index(["html", "xml"], &ft) != -1 +endfun + fun! IsCommentStart(line) " &comments aren't reliable - return HasCStyleComments() && a:line =~ '/\*' + return (HasCStyleComments() && a:line =~ '/\*') || (HasHTMLStyleComments() && a:line =~ '') endfun fun! IsCommentLine(line)