diff options
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r-- | lib/msgstore.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go index 3a78e9e1..34c26761 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -676,7 +676,11 @@ func (store *MessageStore) NextPrev(delta int) { return } idx := store.SelectedIndex() + delta - store.Select(idx) + if idx < 0 { + store.Select(0) + } else { + store.Select(idx) + } store.updateVisual() nextResultIndex := len(store.results) - store.resultIndex - 2*delta if nextResultIndex < 0 || nextResultIndex >= len(store.results) { |