kakoune
kakoune copied to clipboard
[BUG] Overlapping range-specs used with replace-ranges break UI
Version of Kakoune
v2023.08.05-154-g9797c27e
Reproducer
Open an empty buffer and enter something like this:
word1️⃣ word2
Then, add overlapping replace ranges:
declare-option range-specs myrange
set window myrange %val{timestamp} '1.5+4|{PrimarySelection}z' '1.8+1|{SecondarySelection}y'
add-highlighter window/ replace-ranges 'myrange'
Outcome
Escape sequences get rendered and menus shift right on affected lines.
Expectations
Either:
- Invalid ranges get rejected and reported
- Invalid ranges get rendered correctly with first/last taking precedence
Additional information
-
This seems to only happen with multi-byte characters. Overlapping ranges with single-byte characters render fine.
-
I would like to know what is the reason for having ranges operate on bytes rather than columns. This often leads to problems with Unicode support in different plugins, see e.g. https://github.com/phaazon/kak-tree-sitter/issues/156.