aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent/xml.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/indent/xml.vim')
-rw-r--r--runtime/indent/xml.vim11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/indent/xml.vim b/runtime/indent/xml.vim
index dbe5be5f25..dcafb467a6 100644
--- a/runtime/indent/xml.vim
+++ b/runtime/indent/xml.vim
@@ -1,6 +1,8 @@
" Language: xml
-" Maintainer: Johannes Zellner <johannes@zellner.org>
-" Last Change: 2012 Jul 25
+" Repository: https://github.com/chrisbra/vim-xml-ftplugin
+" Maintainer: Christian Brabandt <cb@256bit.org>
+" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: 20180724 - Correctly indent xml comments https://github.com/vim/vim/issues/3200
" Notes: 1) does not indent pure non-xml code (e.g. embedded scripts)
" 2) will be confused by unbalanced tags in comments
" or CDATA sections.
@@ -55,9 +57,6 @@ fun! <SID>XmlIndentSynCheck(lnum)
if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml'
" don't indent pure non-xml code
return 0
- elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment'
- " indent comments specially
- return -1
endif
endif
return 1
@@ -67,7 +66,7 @@ endfun
fun! <SID>XmlIndentSum(lnum, style, add)
let line = getline(a:lnum)
if a:style == match(line, '^\s*</')
- return (&sw *
+ return (shiftwidth() *
\ (<SID>XmlIndentWithPattern(line, b:xml_indent_open)
\ - <SID>XmlIndentWithPattern(line, b:xml_indent_close)
\ - <SID>XmlIndentWithPattern(line, '.\{-}/>'))) + a:add