mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-11 22:21:14 -03:00
Revert "reader: Remove two more case-insensitive asserts"
See following commits.
This reverts commit 0778919e7f.
This commit is contained in:
@@ -1645,6 +1645,10 @@ fn combine_command_and_autosuggestion(
|
||||
if !string_prefixes_string(line, autosuggestion) && line.len() < autosuggestion.len() {
|
||||
// We have an autosuggestion which is not a prefix of the command line, i.e. a case
|
||||
// disagreement. Decide whose case we want to use.
|
||||
assert!(string_prefixes_string_case_insensitive(
|
||||
line,
|
||||
autosuggestion
|
||||
));
|
||||
// Here we do something funny: if the last token of the command line contains any uppercase
|
||||
// characters, we use its case. Otherwise we use the case of the autosuggestion. This
|
||||
// is an idea from issue #335.
|
||||
@@ -2003,6 +2007,11 @@ fn try_apply_edit_to_autosuggestion(&mut self, edit: &Edit) -> bool {
|
||||
// the autosuggestion.
|
||||
// This is also the main mechanism by which readline commands that don't change the command line
|
||||
// text avoid recomputing the autosuggestion.
|
||||
assert!(string_prefixes_string_maybe_case_insensitive(
|
||||
autosuggestion.icase,
|
||||
&self.command_line.text()[autosuggestion.search_string_range.clone()],
|
||||
&autosuggestion.text
|
||||
));
|
||||
let search_string_range = autosuggestion.search_string_range.clone();
|
||||
|
||||
// This is a heuristic with false negatives but that seems fine.
|
||||
|
||||
Reference in New Issue
Block a user