diff options
-rw-r--r-- | commands/account/search.go | 2 | ||||
-rw-r--r-- | lib/msgstore.go | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/commands/account/search.go b/commands/account/search.go index 290aafca..82099249 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -46,7 +46,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { logging.Infof("Filter results: %v", store.Uids()) } } - store.Sort(nil, cb) + store.Sort(store.GetCurrentSortCriteria(), cb) } else { acct.SetStatus(statusline.Search("Searching...")) cb := func(uids []uint32) { diff --git a/lib/msgstore.go b/lib/msgstore.go index c9f8fd91..d9140d7b 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -801,11 +801,7 @@ func (store *MessageStore) ModifyLabels(uids []uint32, add, remove []string, } func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func(types.WorkerMessage)) { - if criteria == nil { - criteria = store.sortCriteria - } else { - store.sortCriteria = criteria - } + store.sortCriteria = criteria store.Sorting = true handle_return := func(msg types.WorkerMessage) { @@ -828,6 +824,10 @@ func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func(types.W } } +func (store *MessageStore) GetCurrentSortCriteria() []*types.SortCriterion { + return store.sortCriteria +} + // returns the index of needle in haystack or -1 if not found func (store *MessageStore) visualStartIdx() int { for idx, u := range store.Uids() { |