diff options
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r-- | lib/msgstore.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go index 42795afb..3a78e9e1 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -675,13 +675,8 @@ func (store *MessageStore) NextPrev(delta int) { if len(uids) == 0 { return } - store.selected += delta - if store.selected < 0 { - store.selected = 0 - } - if store.selected >= len(uids) { - store.selected = len(uids) - 1 - } + idx := store.SelectedIndex() + delta + store.Select(idx) store.updateVisual() nextResultIndex := len(store.results) - store.resultIndex - 2*delta if nextResultIndex < 0 || nextResultIndex >= len(store.results) { |