helix/helix-term
Michael Davis c9dc940428
Fix byte/char indexing mix-up in path completion
The positions passed to `Transaction::change_by_selection` should be
character indexes. `edit_diff` is meant to track the number of
characters that should be deleted to erase the file name that has been
typed so far (if any). Mistakenly this was using `str::len` which is
the byte count. This fixes a bug that could cause more text to be
deleted than intended or a panic when completing a directory with
multi-byte characters like 'éclair'.

This change also moves the `edit_diff` binding out of the loop since
it's now performing some non-trivial work (counting characters, where
before it was just accessing the pre-computed number of bytes).
2025-01-29 10:05:21 -05:00
..
src Fix byte/char indexing mix-up in path completion 2025-01-29 10:05:21 -05:00
tests feat: passing multile of the same files in the arguments places a cursor at each position (#12192) 2025-01-23 14:04:02 -06:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
Cargo.toml build(deps): bump the rust-dependencies group with 2 updates (#12707) 2025-01-27 17:19:26 -06:00
build.rs chore: clean up clippy lints (#11377) 2024-08-01 06:39:46 +09:00