~dricottone/vim-xml

4dcff34f9b7a6b0fbefa9e265690c1567042528a — Dominic Ricottone 2 years ago f97ff1b
Merging part of Oct 26, 2019 upstream commit

Reworking of XML end tag handling.

This does break my fork.
1 files changed, 13 insertions(+), 11 deletions(-)

M syntax/xml.vim
M syntax/xml.vim => syntax/xml.vim +13 -11
@@ 1,12 1,15 @@
" Vim syntax file
" Language: XML
" Maintainer: Dominic Ricottone <me@dominic-ricottone.com>
" Previous Maintainers: Johannes Zellner <johannes@zellner.org>
" Previous Maintainers: Christian Brabandt <cb@256bit.org>
"                       Johannes Zellner <johannes@zellner.org>
"                       Paul Siegmann <pauls@euronet.nl>
"                       Lorenzo Ruiz <lars.bs@hotmail.com>
" Last Change: 2016 Jan 01
" Last Change: Sept 24, 2019
" Filenames: *.xml
" $Id: xml.vim,v 1.3 2006/04/11 21:32:00 vimboss Exp $
" Last Change:
" 20190923 - Fix xmlEndTag to match xmlTag (vim/vim#884)
" 20190924 - Fix xmlAttribute property (amadeus/vim-xml@d8ce1c946)

" CONFIGURATION:
"   syntax folding can be turned on by


@@ 82,7 85,7 @@ syn match   xmlEqual +=+ display
"      ^^^^^^^^^^^^^
"
syn match   xmlAttrib
    \ +[-'"<]\@1<!\<[a-zA-Z:_][-.0-9a-zA-Z:_]*\>\%(['">]\@!\|$\)+
    \ +[-'"<]\@1<!\<[a-zA-Z:_][-.0-9a-zA-Z:_]*\>\%(['"]\@!\|$\)+
    \ contained
    \ contains=xmlAttribPunct,@xmlAttribHook
    \ display


@@ 123,7 126,7 @@ endif
"  ^^^
"
syn match   xmlTagName
    \ +<\@1<=[^ /!?<>"']\++
    \ +\%(<\|</\)\@2<=[^ /!?<>"']\++
    \ contained
    \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
    \ display


@@ 158,12 161,12 @@ if exists('g:xml_syntax_folding')
    " </tag>
    " ^^^^^^
    "
    syn match   xmlEndTag
	\ +</[^ /!?<>"']\+>+
    syn region   xmlEndTag
	\ matchgroup=xmlTag start=+</[^ /!?<>"']\@=+
	\ matchgroup=xmlTag end=+>+
	\ contained
	\ contains=xmlTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook


    " tag elements with syntax-folding.
    " NOTE: NO HIGHLIGHTING -- highlighting is done by contained elements
    "


@@ 182,7 185,7 @@ if exists('g:xml_syntax_folding')
	\ start=+<\z([^ /!?<>"']\+\)+
	\ skip=+<!--\_.\{-}-->+
	\ end=+</\z1\_\s\{-}>+
	\ matchgroup=xmlEndTag end=+/>+
	\ end=+/>+
	\ fold
	\ contains=xmlTag,xmlEndTag,xmlCdata,xmlRegion,xmlComment,xmlEntity,xmlProcessing,@xmlRegionHook,@Spell
	\ keepend


@@ 202,7 205,7 @@ else
    syn region   xmlEndTag
	\ matchgroup=xmlTag start=+</[^ /!?<>"']\@=+
	\ matchgroup=xmlTag end=+>+
        \ contains=xmlTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook
	\ contains=xmlTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook

endif



@@ 346,4 349,3 @@ let &cpo = s:xml_cpo_save
unlet s:xml_cpo_save

" vim: ts=8