From 229e7b68af38c2dda37a3191c0f70f5d2e872294 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Thu, 27 Oct 2022 15:35:40 -0500 Subject: 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 Acked-by: Robin Jarry --- lib/msgstore.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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() { -- cgit