summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-17 17:51:14 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-17 17:51:14 -0400
commitc0146efaaee1f777f8eea8ad6c9e4477e346103b (patch)
tree27b18587d17217c662aa97662c73c90cb4fa7ca5 /widgets
parentb18e339a55dc2b6d459c93735320cdfc23115f56 (diff)
downloadaerc-c0146efaaee1f777f8eea8ad6c9e4477e346103b.tar.gz
Fix scrolling issues on :select-message
Diffstat (limited to 'widgets')
-rw-r--r--widgets/msglist.go7
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) {
@akkartik.com> 2015-10-02 00:34:44 -0700 2235' href='/akkartik/mu/commit/tangle.mu?h=main&id=662d2a27d14115956015334eae786b74304cfbb8'>662d2a27 ^
20d1c905 ^

662d2a27 ^
20d1c905 ^
9458918f ^
ce87c19e ^
1ead3562 ^
20d1c905 ^

662d2a27 ^
20d1c905 ^
192d59d3 ^

32241605 ^
20d1c905 ^

1ead3562 ^
192d59d3 ^
d66e2783 ^
192d59d3 ^
20d1c905 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37