ZIm/crates/vim/test_data/test_space_only_ascii_eol.json
Peter Finn bda33ec436
vim: Fix space forward bug with non-ASCII characters at EOL (#27860)
Closes https://github.com/zed-industries/zed/issues/27619

Fixes issue with right wrapped movement when a multi-byte character is
at the end of the line. This is done by grabbing the last character on
the current row and using that characters size to calculate the
`max_column` variable, which is used to decide if the next right
movement should move down the line or not.

We did notice a bit of code that could be an issue that we wanted to
call out.
[Here](https://github.com/zed-industries/zed/blob/main/crates/editor/src/display_map.rs#L1070)
inside of `clip_at_line_end` it also does a saturating_sub(1), assuming
a single byte character. We didn't run into any issues due to this line
but felt like a similar bug. We can apply a similar fix if wanted to
pose the question first.

Test case: Moving to next line when eol is a multi-byte character


https://github.com/user-attachments/assets/1021ab1f-f49d-4986-8f9a-8cfc7e5c91bc


Release Notes:

- Fixed issue in vim forward spacing when a multi-byte character is at
the eol

---------

Co-authored-by: KyleBarton <kjbarton4@gmail.com>
2025-04-01 18:21:41 +00:00

4 lines
128 B
JSON

{"Put":{"state":"aaaaˇaa\nanotherline"}}
{"Key":"4"}
{"Key":"space"}
{"Get":{"state":"aaaaaa\nanˇotherline","mode":"Normal"}}