Skip to content

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

Open
@ilyagr

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions