diff runtime/autoload/xmlformat.vim @ 15131:bc1a8d21c811

Update runtime files. commit https://github.com/vim/vim/commit/d47d52232bf21036c5c89081458be7eaf2630d24 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 9 20:43:55 2018 +0100 Update runtime files.
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 Dec 2018 20:45:05 +0100
parents 2f7e67dd088c
children 6d11fc4aa683
line wrap: on
line diff
--- a/runtime/autoload/xmlformat.vim
+++ b/runtime/autoload/xmlformat.vim
@@ -1,9 +1,9 @@
 " Vim plugin for formatting XML
-" Last Change: Thu, 22 May 2018 21:26:55 +0100
-" Version: 0.1
-" Author: Christian Brabandt <cb@256bit.org>
-" Repository:   https://github.com/chrisbra/vim-xml-ftplugin
-" License: VIM License
+" Last Change: Thu, 07 Dec 2018
+"     Version: 0.1
+"      Author: Christian Brabandt <cb@256bit.org>
+"  Repository: https://github.com/chrisbra/vim-xml-ftplugin
+"     License: VIM License
 " Documentation: see :h xmlformat.txt (TODO!)
 " ---------------------------------------------------------------------
 " Load Once: {{{1
@@ -85,7 +85,11 @@ func! s:Trim(item)
 endfunc
 " Check if tag is a new opening tag <tag> {{{1
 func! s:StartTag(tag)
-  return a:tag =~? '^\s*<[^/?]'
+  let is_comment = s:IsComment(a:tag)
+  return a:tag =~? '^\s*<[^/?]' && !is_comment
+endfunc
+func! s:IsComment(tag)
+  return a:tag =~? '<!--'
 endfunc
 " Remove one level of indentation {{{1
 func! s:DecreaseIndent()