Fix backward-delete-char not stopping after control characters

Fixes 146384abc6 (Stop using wcwidth entirely, 2026-03-15)

Fixes #12583
This commit is contained in:
Johannes Altmanninger
2026-03-29 10:41:31 +08:00
parent 34fc573668
commit 7f6dcde5e0

View File

@@ -2207,7 +2207,7 @@ fn delete_char(&mut self, backward: bool /* = true */) {
// width at least 1.
loop {
pos -= 1;
if fish_wcwidth(el.text().char_at(pos)).is_some_and(|w| w != 0) || pos == 0 {
if fish_wcwidth(el.text().char_at(pos)).is_none_or(|w| w != 0) || pos == 0 {
break;
}
}