mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Fix regression causing crash when we should clamp negative wcwidth
Fixes c41dbe455
(Also use control pictures for pager prefix,
2024-10-19).
Fixes #10836
This commit is contained in:
parent
373c5b1e14
commit
5e3fdf3320
1 changed files with 2 additions and 2 deletions
|
@ -1953,11 +1953,11 @@ fn rendered_character(c: char) -> char {
|
|||
}
|
||||
|
||||
fn wcwidth_rendered_min_0(c: char) -> usize {
|
||||
usize::try_from(wcwidth_rendered(c)).unwrap()
|
||||
usize::try_from(wcwidth_rendered(c)).unwrap_or_default()
|
||||
}
|
||||
pub fn wcwidth_rendered(c: char) -> isize {
|
||||
fish_wcwidth(rendered_character(c))
|
||||
}
|
||||
pub fn wcswidth_rendered(s: &wstr) -> isize {
|
||||
s.chars().map(|c| fish_wcwidth(rendered_character(c))).sum()
|
||||
s.chars().map(wcwidth_rendered).sum()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue