From c0146efaaee1f777f8eea8ad6c9e4477e346103b Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 17 Mar 2019 17:51:14 -0400 Subject: Fix scrolling issues on :select-message --- widgets/msglist.go | 7 +++++++ 1 file changed, 7 insertions(+) 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) { -- cgit 1.4.1-2-gfad0 'h' onchange='this.form.submit();'> Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.Kartik K. Agaram <vc@akkartik.com>
about summary refs log blame commit diff stats
path: root/html/063array.mu.html
blob: 0a604f12f2525e6f0ee2114533f82fb0e25eda21 (plain) (tree)
1
2
3
4
5
6
7
8
9