~dricottone/vim-xml

c922ea6fd50ab9235b0b2b31de2e2972700c535c — Dominic Ricottone 2 years ago 4dcff34
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.
1 files changed, 10 insertions(+), 4 deletions(-)

M syntax/xml.vim
M syntax/xml.vim => syntax/xml.vim +10 -4
@@ 126,11 126,16 @@ endif
"  ^^^
"
syn match   xmlTagName
    \ +\%(<\|</\)\@2<=[^ /!?<>"']\++
    \ +<\@1<=[^ /!?<>"']\++
    \ contained
    \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
    \ display

syn match   xmlEndTagName
    \ +\%(</\)\@2<=[^ /!?<>"']\++
    \ 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