sort: clear sort criteria when called without arguments
Fix a regression introduced by commitc2f4404fca
("threading: enable filtering of server-side threads"). Prior to this commit, a :sort command (no args) would clear out the current sort criteria (or rather, apply the value from the config). Restore this functionality. Fixes:c2f4404fca
("threading: enable filtering of server-side threads") Reported-by: akspecs <akspecs@gmail.com> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
parent
26b9c3d966
commit
6db766260b
2 changed files with 6 additions and 6 deletions
|
@ -46,7 +46,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
logging.Infof("Filter results: %v", store.Uids())
|
logging.Infof("Filter results: %v", store.Uids())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
store.Sort(nil, cb)
|
store.Sort(store.GetCurrentSortCriteria(), cb)
|
||||||
} else {
|
} else {
|
||||||
acct.SetStatus(statusline.Search("Searching..."))
|
acct.SetStatus(statusline.Search("Searching..."))
|
||||||
cb := func(uids []uint32) {
|
cb := func(uids []uint32) {
|
||||||
|
|
|
@ -801,11 +801,7 @@ func (store *MessageStore) ModifyLabels(uids []uint32, add, remove []string,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func(types.WorkerMessage)) {
|
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
|
store.Sorting = true
|
||||||
|
|
||||||
handle_return := func(msg types.WorkerMessage) {
|
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
|
// returns the index of needle in haystack or -1 if not found
|
||||||
func (store *MessageStore) visualStartIdx() int {
|
func (store *MessageStore) visualStartIdx() int {
|
||||||
for idx, u := range store.Uids() {
|
for idx, u := range store.Uids() {
|
||||||
|
|
Loading…
Reference in a new issue