diff options
author | cos <cos> | 2022-07-26 20:38:24 +0200 |
---|---|---|
committer | cos <cos> | 2022-07-26 22:47:44 +0200 |
commit | f5c9f2d0111527b5d5d2efed2e94a01b9f382709 (patch) | |
tree | ef92c037d9fe0fbc1372fa0ab5e96acd38267d65 /widgets | |
parent | a70697d1224cbb13dae99a50238e62650eee587c (diff) | |
download | aerc-topic/asc_sort_imap.zip |
fixup: Hack up message list to be sorted ascendingtopic/asc_sort_imap
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.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/account.go | 1 | ||||
-rw-r--r-- | widgets/msglist.go | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/widgets/account.go b/widgets/account.go index 6e03160..75373aa 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -294,6 +294,7 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) { } else { store = lib.NewMessageStore(acct.worker, msg.Info, acct.GetSortCriteria(), + acct.UiConfig().MsgListOrdAscending, acct.UiConfig().ThreadingEnabled, acct.UiConfig().ForceClientThreads, func(msg *models.MessageInfo) { 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 } |