From c922ea6fd50ab9235b0b2b31de2e2972700c535c Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Thu, 15 Sep 2022 14:52:29 -0500 Subject: [PATCH] Fix my fork The previous commit from upstream fundamentally broke my fork. While the new method of matching tags is better, it treats beginning and end tags as equivalent. I have once again re-worked the handling of end tags to acheive the same effect. --- syntax/xml.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/syntax/xml.vim b/syntax/xml.vim index 5f2d5f9..2d96b7f 100644 --- a/syntax/xml.vim +++ b/syntax/xml.vim @@ -126,11 +126,16 @@ endif " ^^^ " syn match xmlTagName - \ +\%(<\|"']\++ + \ +<\@1<=[^ /!?<>"']\++ \ contained \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook \ display +syn match xmlEndTagName + \ +\%("']\++ + \ contained + \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook + \ display if exists('g:xml_syntax_folding') @@ -165,7 +170,7 @@ if exists('g:xml_syntax_folding') \ matchgroup=xmlTag start=+"']\@=+ \ matchgroup=xmlTag end=+>+ \ contained - \ contains=xmlTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook + \ contains=xmlEndTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook " tag elements with syntax-folding. " NOTE: NO HIGHLIGHTING -- highlighting is done by contained elements @@ -205,7 +210,7 @@ else syn region xmlEndTag \ matchgroup=xmlTag start=+"']\@=+ \ matchgroup=xmlTag end=+>+ - \ contains=xmlTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook + \ contains=xmlEndTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook endif @@ -314,7 +319,8 @@ syn sync minlines=100 hi def link xmlTodo Todo hi def link xmlTag Function hi def link xmlTagName Function -hi def link xmlEndTag Function +hi def link xmlEndTagName Comment +hi def link xmlEndTag Identifier if !exists("g:xml_namespace_transparent") hi def link xmlNamespace Tag endif -- 2.45.2