helix icon indicating copy to clipboard operation
helix copied to clipboard

Fix jump label rendering for multi-byte characters

Open tm99hjkl opened this issue 6 months ago • 4 comments

Fixed rendering issue when jump labels are given to multibyte characters.

Specifically, when the character to which the label is given is a multibyte character, a process to convert the label to a full-width character has been added.

Example:

Screencast from 2025-06-07 12-50-18.webm

tm99hjkl avatar Jun 07 '25 04:06 tm99hjkl

I do agree with jump on multibyte characters shouldn't mess up the rendering, but I rather it not be padded with space, for example これは should be shown as arれは instead of a r は or is there any specific reason you did so? That way both the jump labels will remain readable and consistent (without extra spaces) and at the same time the rendering remains the same.

pickfire avatar Jun 09 '25 16:06 pickfire

Currently, only one Overlay can be assigned to each document character at most, so the ar label could not be assigned to (It is not padded with whitespace, but overlaid with a single double-byte character).

In order to minimize the diff as much as possible, I had to compromise in this way.

tm99hjkl avatar Jun 09 '25 20:06 tm99hjkl

If we are going to change this, might as well tweak Overlay too, that's what I think.

pickfire avatar Jun 10 '25 13:06 pickfire

I will try. Thank you.

tm99hjkl avatar Jun 10 '25 14:06 tm99hjkl

Nit: the title and description say "multi-byte", but isn't it rather "multi-cell"? Because if I understand correctly, this is about visual width, not the number of bytes a character takes up in memory.

For example, there are many multi-byte characters that are single-width, and the single-byte tab character can be multiple terminal cells wide.

cessen avatar Aug 17 '25 12:08 cessen