mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
fix bug in ~ completion
Fix bug introduced by commitc114cbc9a
that causes only the first match for a ~ completion to be available for selection. Fixes #4075 (cherry picked from commiteff2a3c3a3
)
This commit is contained in:
parent
8ed63d63a4
commit
1c06067d0d
1 changed files with 0 additions and 2 deletions
|
@ -1207,14 +1207,12 @@ bool completer_t::try_complete_user(const wcstring &str) {
|
||||||
wcstring desc = format_string(COMPLETE_USER_DESC, pw_name);
|
wcstring desc = format_string(COMPLETE_USER_DESC, pw_name);
|
||||||
append_completion(&this->completions, &pw_name[name_len], desc, COMPLETE_NO_SPACE);
|
append_completion(&this->completions, &pw_name[name_len], desc, COMPLETE_NO_SPACE);
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
|
||||||
} else if (wcsncasecmp(user_name, pw_name, name_len) == 0) {
|
} else if (wcsncasecmp(user_name, pw_name, name_len) == 0) {
|
||||||
wcstring name = format_string(L"~%ls", pw_name);
|
wcstring name = format_string(L"~%ls", pw_name);
|
||||||
wcstring desc = format_string(COMPLETE_USER_DESC, pw_name);
|
wcstring desc = format_string(COMPLETE_USER_DESC, pw_name);
|
||||||
append_completion(&this->completions, name, desc,
|
append_completion(&this->completions, name, desc,
|
||||||
COMPLETE_REPLACES_TOKEN | COMPLETE_DONT_ESCAPE | COMPLETE_NO_SPACE);
|
COMPLETE_REPLACES_TOKEN | COMPLETE_DONT_ESCAPE | COMPLETE_NO_SPACE);
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we've spent too much time (more than 200 ms) doing this give up.
|
// If we've spent too much time (more than 200 ms) doing this give up.
|
||||||
|
|
Loading…
Reference in a new issue