diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-07-05 14:48:41 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-07-10 21:15:12 +0200 |
commit | a953e4dbe914def4275a6ddfc16e3046804fe03e (patch) | |
tree | 1f13c056b0f80caf5f2d9ac00792839ed198f14d /commands | |
parent | c2f4404fca15be37228545b1893f5fa335168337 (diff) | |
download | aerc-a953e4dbe914def4275a6ddfc16e3046804fe03e.tar.gz |
threading: refactor reselect logic
This patch refactors reselection of a message during certain operations
(searching, filtering, clearing, deleting, moving, new message arrival).
The addition of server-side filtering for threaded views broke the
existing reselection logic.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/account/clear.go | 3 | ||||
-rw-r--r-- | commands/msg/toggle-threads.go | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/commands/account/clear.go b/commands/account/clear.go index 69fac2dc..5bab7109 100644 --- a/commands/account/clear.go +++ b/commands/account/clear.go @@ -52,9 +52,8 @@ func (Clear) Execute(aerc *widgets.Aerc, args []string) error { if clearSelected { defer store.Select(0) } else { - defer store.Reselect(store.Selected()) + store.SetReselect(store.Selected()) } - store.ApplyClear() acct.SetStatus(statusline.SearchFilterClear()) diff --git a/commands/msg/toggle-threads.go b/commands/msg/toggle-threads.go index aa0e6559..05c2c5e1 100644 --- a/commands/msg/toggle-threads.go +++ b/commands/msg/toggle-threads.go @@ -34,7 +34,7 @@ func (ToggleThreads) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { return err } - defer store.Reselect(store.Selected()) + store.SetReselect(store.Selected()) store.SetThreadedView(!store.ThreadedView()) acct.SetStatus(statusline.Threading(store.ThreadedView())) acct.Messages().Invalidate() |