mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 08:11:15 -03:00
Fix to properly handle case insensitive autosuggestions
This commit is contained in:
@@ -1961,6 +1961,11 @@ bool string_prefixes_string(const wcstring &proposed_prefix, const wcstring &val
|
||||
return prefix_size <= value.size() && value.compare(0, prefix_size, proposed_prefix) == 0;
|
||||
}
|
||||
|
||||
bool string_prefixes_string_case_insensitive(const wcstring &proposed_prefix, const wcstring &value) {
|
||||
size_t prefix_size = proposed_prefix.size();
|
||||
return prefix_size <= value.size() && wcsncasecmp(proposed_prefix.c_str(), value.c_str(), prefix_size) == 0;
|
||||
}
|
||||
|
||||
bool list_contains_string(const wcstring_list_t &list, const wcstring &str)
|
||||
{
|
||||
return std::find(list.begin(), list.end(), str) != list.end();
|
||||
|
||||
Reference in New Issue
Block a user