diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-03-17 17:51:14 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-17 17:51:14 -0400 |
commit | c0146efaaee1f777f8eea8ad6c9e4477e346103b (patch) | |
tree | 27b18587d17217c662aa97662c73c90cb4fa7ca5 /widgets/msglist.go | |
parent | b18e339a55dc2b6d459c93735320cdfc23115f56 (diff) | |
download | aerc-c0146efaaee1f777f8eea8ad6c9e4477e346103b.tar.gz |
Fix scrolling issues on :select-message
Diffstat (limited to 'widgets/msglist.go')
-rw-r--r-- | widgets/msglist.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go index e3b524d..ab25847 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -119,6 +119,13 @@ func (ml *MessageList) Select(index int) { if ml.selected > len(ml.store.Uids) { ml.selected = len(ml.store.Uids) } + // I'm too lazy to do the math right now + for ml.selected-ml.scroll >= ml.Height() { + ml.scroll += 1 + } + for ml.selected-ml.scroll < 0 { + ml.scroll -= 1 + } } func (ml *MessageList) nextPrev(delta int) { |