aboutsummaryrefslogtreecommitdiff
path: root/widgets/msglist.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/msglist.go')
-rw-r--r--widgets/msglist.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 228477d..df0366d 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -12,7 +12,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/lib/format"
"git.sr.ht/~sircmpwn/aerc/lib/ui"
"git.sr.ht/~sircmpwn/aerc/models"
- "git.sr.ht/~sircmpwn/aerc/worker/types"
+ //"git.sr.ht/~sircmpwn/aerc/worker/types"
)
type MessageList struct {
@@ -71,16 +71,16 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
uids := store.Uids()
if ml.conf.Ui.ThreadingEnabled {
- threads := store.Threads
+ if store.ThreadRoot == nil {
+ return
+ }
- for i := len(threads) - 1; i >= 0; i-- {
- threads[i].FormatThread(func(thread *types.Thread, threadFmt []rune) bool {
- if ml.drawRow(ctx, thread.Uid, row, row, &needsHeaders, string(threadFmt)) {
- return true
- }
- row += 1
- return false
- })
+ for i := ml.scroll; i < len(store.FlatThreads); i++ {
+ thread := store.FlatThreads[i]
+ if ml.drawRow(ctx, thread.Uid, row, row, &needsHeaders, string(thread.DrawThread())) {
+ break
+ }
+ row += 1
}
} else {
for i := len(uids) - 1 - ml.scroll; i >= 0; i-- {