From 687c4777b553659de51f525ac914d4fa97270245 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Sun, 31 Jul 2022 22:20:24 +0200 Subject: [PATCH] store: fix nexprev when filtering Select the first message with NextPrev when the cursor disappears after applying a filter where the selected message is not part of. Currently, the NextPrev would select the last message in the mailbox (like a G jump). To reproduce: 1) select a message 2) apply a filter where the selected message is not selected 3) move the cursor and it will jump to the last message Signed-off-by: Koni Marti Acked-by: Robin Jarry --- lib/msgstore.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/msgstore.go b/lib/msgstore.go index d9140d7..b91cd82 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -696,6 +696,7 @@ func (store *MessageStore) NextPrev(delta int) { newIdx := store.FindIndexByUid(uid) if newIdx < 0 { store.Select(uids[len(uids)-1]) + return } newIdx -= delta