mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 19:53:36 +08:00
Correct prefix length calculation in completion measurement
A completion may have zero length; in this case the length of the prefix was omitted and the completion was not visible. Correct the calculation to account for zero-width completions. Fixes #4424
This commit is contained in:
parent
0d93125664
commit
43d0016125
|
@ -328,7 +328,7 @@ void pager_t::measure_completion_infos(comp_info_list_t *infos, const wcstring &
|
|||
|
||||
// fish_wcswidth() can return -1 if it can't calculate the width. So be cautious.
|
||||
int comp_width = fish_wcswidth(comp_strings.at(j).c_str());
|
||||
if (comp_width > 0) comp->comp_width += prefix_len + comp_width;
|
||||
if (comp_width >= 0) comp->comp_width += prefix_len + comp_width;
|
||||
}
|
||||
|
||||
// fish_wcswidth() can return -1 if it can't calculate the width. So be cautious.
|
||||
|
|
Loading…
Reference in New Issue
Block a user