When kitty_mod (or a map command with no inline action) is defined at the end of a line without a trailing space (for example: kitty_mod ctrl+shift), the kittyMapSeq region fails to terminate on that line.
This happens because Vim's \s matches spaces and tabs but not newlines, meaning the current ending pattern end="\ze\s\|^\ze[ \t]*\\" cannot be triggered at the end of the line. As a result, the region leaks into subsequent lines, corrupting the syntax highlighting of the next map definitions (e.g., highlighting map as kittyKey instead of kittyMapName).
Added \|\ze$ to the end pattern of kittyMapSeq:
syn region kittyMapSeq start="\S" end="\ze\s\|^\ze[ \t]*\\\|\ze$" ...
This allows the region to terminate correctly at the end of the line (zero-width match before $) without consuming the newline character, leaving it to be handled by the parent region (like kittyMod) to close safely.
kitty.conf (ensuring no trailing space at the end of the first line):
kitty_mod ctrl+shift map kitty_mod+enter launch
map on the second line is incorrectly highlighted as kittyKey (Special). With this fix, it is correctly highlighted as kittyMapName (Function).https://github.com/vim/vim/pull/20422
(1 file)
—
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.![]()
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.![]()