diff options
-rw-r--r-- | commands/account/sort.go | 5 | ||||
-rw-r--r-- | lib/statusline/folderstate.go | 4 | ||||
-rw-r--r-- | lib/statusline/state.go | 9 |
3 files changed, 16 insertions, 2 deletions
diff --git a/commands/account/sort.go b/commands/account/sort.go index c08991c8..a35ff333 100644 --- a/commands/account/sort.go +++ b/commands/account/sort.go @@ -6,6 +6,7 @@ import ( "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib/sort" + "git.sr.ht/~rjarry/aerc/lib/statusline" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~rjarry/aerc/worker/types" ) @@ -82,9 +83,9 @@ func (Sort) Execute(aerc *widgets.Aerc, args []string) error { } } - aerc.SetStatus("Sorting") + acct.SetStatus(statusline.Sorting(true)) store.Sort(sortCriteria, func() { - aerc.SetStatus("Sorting complete") + acct.SetStatus(statusline.Sorting(false)) }) return nil } diff --git a/lib/statusline/folderstate.go b/lib/statusline/folderstate.go index 50a8c82b..ff470b72 100644 --- a/lib/statusline/folderstate.go +++ b/lib/statusline/folderstate.go @@ -4,6 +4,7 @@ type folderState struct { Search string Filter string FilterActivity string + Sorting string Threading string } @@ -21,6 +22,9 @@ func (fs *folderState) State() []string { if fs.Search != "" { line = append(line, fs.Search) } + if fs.Sorting != "" { + line = append(line, fs.Sorting) + } if fs.Threading != "" { line = append(line, fs.Threading) } diff --git a/lib/statusline/state.go b/lib/statusline/state.go index fe32626a..895bb2c4 100644 --- a/lib/statusline/state.go +++ b/lib/statusline/state.go @@ -109,6 +109,15 @@ func Search(desc string) SetStateFunc { } } +func Sorting(on bool) SetStateFunc { + return func(s *State, folder string) { + s.folderState(folder).Sorting = "" + if on { + s.folderState(folder).Sorting = "sorting" + } + } +} + func Threading(on bool) SetStateFunc { return func(s *State, folder string) { s.folderState(folder).Threading = "" |