From f5c9f2d0111527b5d5d2efed2e94a01b9f382709 Mon Sep 17 00:00:00 2001 From: cos Date: Tue, 26 Jul 2022 20:38:24 +0200 Subject: fixup: Hack up message list to be sorted ascending An attempt at making ascending or descending message list configurable. Seems to work for me, but a proper take on this might need to involve having to rethink what configuration options to present and how direct they map towards the operations happening under the hood. --- widgets/msglist.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'widgets/msglist.go') diff --git a/widgets/msglist.go b/widgets/msglist.go index 395fb54..c1bf0f4 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -93,8 +93,14 @@ func (ml *MessageList) Draw(ctx *ui.Context) { counter := len(store.Uids()) for i := 0; i < len(threads); i++ { + var j = 0 + if ml.conf.Ui.MsgListOrdAscending { + j = i + } else { + j = len(threads) - i - 1 + } var lastSubject string - threads[i].Walk(func(t *types.Thread, _ int, currentErr error) error { + threads[j].Walk(func(t *types.Thread, _ int, currentErr error) error { if currentErr != nil { return currentErr } -- cgit v1.2.3