mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Assert that autosuggestions are always valid
This documents an invariant established by532abaddae(Invalidate stale autosuggestions eagerly, 2024-12-25). It was initially broken but fixed inba4ead6ead(Stop saving autosuggestions that we can't restore, 2025-01-17).
This commit is contained in:
@@ -4881,7 +4881,13 @@ fn update_autosuggestion(&mut self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let el = &self.data.command_line;
|
let el = &self.data.command_line;
|
||||||
|
let autosuggestion = &self.autosuggestion;
|
||||||
if self.is_at_line_with_autosuggestion() {
|
if self.is_at_line_with_autosuggestion() {
|
||||||
|
assert!(string_prefixes_string_maybe_case_insensitive(
|
||||||
|
autosuggestion.icase,
|
||||||
|
&el.text()[autosuggestion.search_string_range.clone()],
|
||||||
|
&autosuggestion.text
|
||||||
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user