aboutsummaryrefslogtreecommitdiffstats
path: root/lib/msgstore.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-07-31 22:20:24 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-01 10:37:47 +0200
commit687c4777b553659de51f525ac914d4fa97270245 (patch)
tree0576de17710c1e29486f9dbb6044e6c8f0f2b1aa /lib/msgstore.go
parent0c85b5a6cfdae0cbe1d82cc958231e70888bf09f (diff)
downloadaerc-687c4777b553659de51f525ac914d4fa97270245.tar.gz
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 <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r--lib/msgstore.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index d9140d7b..b91cd82d 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