helix/helix-term
Michael Davis d3fb8fc9b8
Fix prompt truncation for non-ASCII lines
The prompt was previously assuming that each grapheme cluster in the
line was single-width and single-byte. Lines like the one in the new
integration test would cause panics because the anchor attempted to
slice into a character.

This change rewrites the anchor and truncation code in the prompt to
account for Unicode segmentation and width. Now multi-width graphemes
can be hidden by multiple consecutive elipses - for example "十" is
hidden by "……" (2-width).

Co-authored-by: Narazaki, Shuji <shujinarazaki@protonmail.com>
2025-06-19 10:44:06 -04:00
..
src Fix prompt truncation for non-ASCII lines 2025-06-19 10:44:06 -04:00
tests Fix prompt truncation for non-ASCII lines 2025-06-19 10:44:06 -04:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
Cargo.toml build(deps): bump the rust-dependencies group with 3 updates (#13777) 2025-06-17 08:54:41 -05:00
build.rs chore: clean up clippy lints (#11377) 2024-08-01 06:39:46 +09:00