mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-20 01:42:56 +08:00
Add early abortion of completion match attempt
This commit is contained in:
parent
0b3b4f3d91
commit
8d25ed962c
|
@ -1053,10 +1053,12 @@ bool completer_t::complete_param(const wcstring &cmd_orig, const wcstring &popt,
|
|||
wcstring whole_opt(o.expected_dash_count(), L'-');
|
||||
whole_opt.append(o.option);
|
||||
|
||||
if (whole_opt.length() < str.length()) {
|
||||
continue;
|
||||
}
|
||||
int match = string_prefixes_string(str, whole_opt);
|
||||
if (!match) {
|
||||
bool match_no_case = wcsncasecmp(str.c_str(), whole_opt.c_str(), str.length()) == 0;
|
||||
|
||||
if (!match_no_case) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user