From 4dcff34f9b7a6b0fbefa9e265690c1567042528a Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Thu, 15 Sep 2022 14:49:50 -0500 Subject: [PATCH] Merging part of Oct 26, 2019 upstream commit Reworking of XML end tag handling. This does break my fork. --- syntax/xml.vim | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/syntax/xml.vim b/syntax/xml.vim index f3f09d1..5f2d5f9 100644 --- a/syntax/xml.vim +++ b/syntax/xml.vim @@ -1,12 +1,15 @@ " Vim syntax file " Language: XML " Maintainer: Dominic Ricottone -" Previous Maintainers: Johannes Zellner +" Previous Maintainers: Christian Brabandt +" Johannes Zellner " Paul Siegmann " Lorenzo Ruiz -" 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\%(['">]\@!\|$\)+ + \ +[-'"<]\@1\%(['"]\@!\|$\)+ \ contained \ contains=xmlAttribPunct,@xmlAttribHook \ display @@ -123,7 +126,7 @@ endif " ^^^ " syn match xmlTagName - \ +<\@1<=[^ /!?<>"']\++ + \ +\%(<\|"']\++ \ contained \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook \ display @@ -158,12 +161,12 @@ if exists('g:xml_syntax_folding') " " ^^^^^^ " - 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=++ - \ 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 - -- 2.45.2