mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.96k stars 715 forks source link

[BUG] Line highlighting does not work on all lines #5001

Closed 4sdx closed 7 months ago

4sdx commented 1 year ago

Version of Kakoune

v2023.08.05

Reproducer

Enable cursor line highlighting by ui.kak or crosshair. Than scrolling through a file, not all lines will be highlighted.

Another way to reproduce:

  1. Open a source file (e.g.: any from Kakoune)
  2. Remove cursor line highlighter: remove-highlighter window/cursorline
  3. Add cursor line highlighter: add-highlighter window/cursorline line <line-number> CursorLine

Outcome

Sometimes the cursor line highlighting works for specific lines, but fails for others.

Expectations

It shall be able to highlight any line in the window.

Additional information

The feature started to malfunction from this commit: e0728d3434d5ea335521484521d246473ca06165

DISSISOR commented 7 months ago

Still true at current master with following in my kakrc:

hook global RawKey .+ %{
    try %{ remove-highlighter window/curhl }
    try %{add-highlighter window/curhl line %val{cursor_line} default,rgb:282828}
}

Though, it doesn't reproduce without adding highlighter for line numbers! Also, it seems to always highlight line with ' and " substrings (UPD: nah, not true, actually. sometimes it is not enough to force highlighter to work) (spaces are intentional. Replaceable with tabs on my config).

mawww commented 7 months ago

Thanks for bumping this up, fix incoming.

DISSISOR commented 7 months ago

Thanks a lot for your work! Already tried and it's awesome. Appreciate a lot.

4sdx commented 7 months ago

I tried too. It works as expected. Thanks for fixing the best code editor! :)