summaryrefslogtreecommitdiff
path: root/widgets/msglist.go
diff options
context:
space:
mode:
authorcos <cos>2022-07-26 20:38:24 +0200
committercos <cos>2022-07-26 22:47:44 +0200
commitf5c9f2d0111527b5d5d2efed2e94a01b9f382709 (patch)
treeef92c037d9fe0fbc1372fa0ab5e96acd38267d65 /widgets/msglist.go
parenta70697d1224cbb13dae99a50238e62650eee587c (diff)
downloadaerc-f5c9f2d0111527b5d5d2efed2e94a01b9f382709.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/msglist.go')
-rw-r--r--widgets/msglist.go8
1 files changed, 7 insertions, 1 deletions
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
}