aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-10-27 15:35:40 -0500
committerRobin Jarry <robin@jarry.cc>2022-11-06 23:17:44 +0100
commit229e7b68af38c2dda37a3191c0f70f5d2e872294 (patch)
treecd66dacc6ef766876f15efb8d790c5bb0b56d8ad /lib
parentb9153795a9cdee36441ec47d9e35274ba4b37f37 (diff)
downloadaerc-229e7b68af38c2dda37a3191c0f70f5d2e872294.tar.gz
msgstore: use default sort when applying Clear
The :clear command clears any sorting, filtering, or marking of messages within the message store. Respect the user's default sort order by storing this in the store and re-applying the default sort when using clear. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index bbda90dd..085ca7f2 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -38,6 +38,7 @@ type MessageStore struct {
filter []string
sortCriteria []*types.SortCriterion
+ sortDefault []*types.SortCriterion
threadedView bool
reverseThreadOrder bool
@@ -100,6 +101,7 @@ func NewMessageStore(worker *types.Worker,
filter: []string{"filter"},
sortCriteria: defaultSortCriteria,
+ sortDefault: defaultSortCriteria,
pendingBodies: make(map[uint32]interface{}),
pendingHeaders: make(map[uint32]interface{}),
@@ -683,7 +685,7 @@ func (store *MessageStore) ApplyClear() {
if store.onFilterChange != nil {
store.onFilterChange(store)
}
- store.Sort(nil, nil)
+ store.Sort(store.sortDefault, nil)
}
func (store *MessageStore) updateResults() {