Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] "wrap" highlighter shows binary files incorrectly, seems to skip sequences of zero bytes #5269

Open
ilyagr opened this issue Jan 6, 2025 · 0 comments
Labels

Comments

@ilyagr
Copy link

ilyagr commented Jan 6, 2025

Version of Kakoune

Kakoune v2024.05.18, Kakoune v2023.08.05-279-ge64babee

Reproducer

  1. Load this base64-encoded file into Kakoune started as HOME=(mktemp -d) kak:

https://gist.github.com/ilyagr/94f555989e9500b3e1ce279e149f971d

(I think the only thing relevant about the file is the long string of 0 bytes)

  1. Run %|base64 -d to decode it
  2. Run :add-highlighter global/ wrap

Note that the long sequence of zeroes is missing.

(Is Kakoune a binary file editor? Probably not. I'm not sure what the priority of this bug should be, but in the ideal world, it wouldn't show something deceptive).

Outcome

To compare, here's what kak shows after line 32 (incorrect):

image

Additionally (I am not sure if this second thing is easy to reproduce), the output was messed up further after I added line number highlighter, and first added and then removed a wrap -width 60 highlighter. The result was:

image

Expectations

Here is what vim -b sees with wrapping on:

image

Additional information

No response

@ilyagr ilyagr added the bug label Jan 6, 2025
@ilyagr ilyagr changed the title [BUG] "wrap" [BUG] "wrap" highlighter shows binary files incorrectly, seems to skip sequences of zero bytes Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant