aboutsummaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorKevin Kuehler <keur@xcf.berkeley.edu>2019-10-28 12:07:06 -0700
committerBen Burwell <ben@benburwell.com>2019-10-29 11:07:51 -0400
commit37f33ad65bfbfa69e620fcb0fdcff6393a251ac7 (patch)
treed80059da33a741e0581eb6a4faffdfadbab7797b /widgets
parent75cbf8dc0376429d6cdb6a6716b6a9b41fb681f1 (diff)
Rework threading and add REFERENCES
* Implement a simplified version of the REFERENCES algorithm * Remove FormatThreads function * Instead of acting on all threads, handle each thread independently Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
Diffstat (limited to 'widgets')
-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-- {