[vim/vim] runtime(html): match plain tag and attribute names as keywords (PR #21155)

2 views
Skip to first unread message

Julien Voisin

unread,
Aug 26, 2026, 9:44:56 AM (5 days ago) Aug 26
to vim/vim, Subscribed

Problem: Several tag and attribute names are highlighted with regular
expression alternations even though they are plain words. A
:syn-match with an alternation is retried at nearly every
position of every tag.
Solution: Move the plain-word tag names (b, i, u, em, strong, head,
body, title, h1-h6) and the "label", "href" and "title"
attribute names into syn-keyword lists, leaving only the
genuinely hyphenated names "accept-charset" and "http-equiv"
as matches.

Profiling a 6000-line HTML file with :syntime, the converted rules drop from a combined 0.044s to 0.004s, lowering total per-rule syntax time by about 15%. Highlighting is unchanged except that a bare valueless "href" attribute is now highlighted as an attribute, consistent with a bare "title", which already behaved that way.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21155

Commit Summary

  • cdf1625 runtime(html): match plain tag and attribute names as keywords

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21155@github.com>

Christian Brabandt

unread,
Aug 26, 2026, 2:48:12 PM (4 days ago) Aug 26
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21155)

Thanks, @dkearns fine with you?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21155/c5429646686@github.com>

Christian Brabandt

unread,
Aug 27, 2026, 4:49:44 PM (3 days ago) Aug 27
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21155)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21155/c5445045876@github.com>

Reply all
Reply to author
Forward
0 new messages