Make :next-result :prev-result relative to cursor
Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
This commit is contained in:
parent
6c0f228451
commit
fe2fef4b75
1 changed files with 9 additions and 0 deletions
|
@ -321,6 +321,15 @@ func (store *MessageStore) nextPrev(delta int) {
|
|||
if store.selected >= len(store.uids) {
|
||||
store.selected = len(store.uids) - 1
|
||||
}
|
||||
nextResultIndex := len(store.results) - store.resultIndex - 2*delta
|
||||
if nextResultIndex < 0 || nextResultIndex >= len(store.results) {
|
||||
return
|
||||
}
|
||||
nextResultUid := store.results[nextResultIndex]
|
||||
selectedUid := store.uids[len(store.uids)-store.selected-1]
|
||||
if nextResultUid == selectedUid {
|
||||
store.resultIndex += delta
|
||||
}
|
||||
}
|
||||
|
||||
func (store *MessageStore) Next() {
|
||||
|
|
Loading…
Reference in a new issue