mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
Fix crash in history pager
ctrl-r ctrl-s ctrl-s Attemps to go before the beginning and asserts out. Instead refuse to do that. (there's some weirdness where it can reduce the pager to the first entry if you keep pressing, which I haven't found yet, but that's better than *crashing*)
This commit is contained in:
@@ -4716,10 +4716,12 @@ fn fill_history_pager(
|
||||
history_pager.direction = direction;
|
||||
match direction {
|
||||
SearchDirection::Forward => {
|
||||
assert!(index > result.final_index);
|
||||
history_pager.can_go_backwards = true;
|
||||
if index == 0 {
|
||||
return;
|
||||
}
|
||||
history_pager.history_index_start = result.final_index;
|
||||
history_pager.history_index_end = index;
|
||||
history_pager.can_go_backwards = true;
|
||||
}
|
||||
SearchDirection::Backward => {
|
||||
history_pager.history_index_start = index;
|
||||
|
||||
Reference in New Issue
Block a user