kakoune icon indicating copy to clipboard operation
kakoune copied to clipboard

[BUG] Overlapping range-specs used with replace-ranges break UI

Open postsolar opened this issue 1 year ago • 0 comments

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.

image

Expectations

Either:

  • Invalid ranges get rejected and reported
  • Invalid ranges get rendered correctly with first/last taking precedence

Additional information

  1. This seems to only happen with multi-byte characters. Overlapping ranges with single-byte characters render fine.

  2. 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.

postsolar avatar Nov 30 '23 08:11 postsolar