aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-07-17 14:09:16 +0200
committerRobin Jarry <robin@jarry.cc>2023-08-04 23:16:29 +0200
commit24eab0f5ef6324b00717997f671cf1d13317bd5c (patch)
treee5a5a373599a8b6ff8720d527778452aa258be12 /widgets
parentf27b2d6150968bc03bfd8ba51b6048def6f4f57f (diff)
downloadaerc-24eab0f5ef6324b00717997f671cf1d13317bd5c.tar.gz
msglist: fetch headers even when not focused
Do not rely on MessageList.Draw only to fetch missing headers. In Draw, report the current scroll offset and length to the message store and use them to determine if a new message UID should be candidate for fetching headers. This allows the mail-received hook to work even when the message list is not focused. Fixes: https://todo.sr.ht/~rjarry/aerc/147 Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tristan Partin <tristan@partin.io>
Diffstat (limited to 'widgets')
-rw-r--r--widgets/msglist.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 8263b945..a334d0d4 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -81,6 +81,8 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
}
}
+ store.UpdateScroll(ml.Scroll(), ml.height)
+
textWidth := ctx.Width()
if ml.NeedScrollbar() {
textWidth -= 1