mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00: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:
parent
7846a232a9
commit
080e40aac0
1 changed files with 4 additions and 2 deletions
|
@ -4716,10 +4716,12 @@ impl ReaderData {
|
||||||
history_pager.direction = direction;
|
history_pager.direction = direction;
|
||||||
match direction {
|
match direction {
|
||||||
SearchDirection::Forward => {
|
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_start = result.final_index;
|
||||||
history_pager.history_index_end = index;
|
history_pager.history_index_end = index;
|
||||||
history_pager.can_go_backwards = true;
|
|
||||||
}
|
}
|
||||||
SearchDirection::Backward => {
|
SearchDirection::Backward => {
|
||||||
history_pager.history_index_start = index;
|
history_pager.history_index_start = index;
|
||||||
|
|
Loading…
Reference in a new issue