aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/xmlformat.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-01 16:43:14 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-01 16:43:14 +0200
commit87140f234ac1f152f6f273dee5ab1e42c7b1d78b (patch)
tree2e8e1b980a4fe1786db5e35a2a44c77b0d2ecce8 /runtime/autoload/xmlformat.vim
parent1f6c9fd82202c14021d0e6aa3f5e4ad89877d2f8 (diff)
parent5342342426777160300a431ef8c9200fb151f793 (diff)
downloadrneovim-87140f234ac1f152f6f273dee5ab1e42c7b1d78b.tar.gz
rneovim-87140f234ac1f152f6f273dee5ab1e42c7b1d78b.tar.bz2
rneovim-87140f234ac1f152f6f273dee5ab1e42c7b1d78b.zip
Merge #10646 'vim-patch: runtime patches'
Diffstat (limited to 'runtime/autoload/xmlformat.vim')
-rw-r--r--runtime/autoload/xmlformat.vim16
1 files changed, 10 insertions, 6 deletions
diff --git a/runtime/autoload/xmlformat.vim b/runtime/autoload/xmlformat.vim
index f227b5ee25..ea89401977 100644
--- 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()