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
.gitignore
build.rs
Cargo.toml build(deps): bump the rust-dependencies group with 2 updates (#12707) 2025-01-27 17:19:26 -06:00