aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-07-05 14:48:41 -0500
committerRobin Jarry <robin@jarry.cc>2022-07-10 21:15:12 +0200
commita953e4dbe914def4275a6ddfc16e3046804fe03e (patch)
tree1f13c056b0f80caf5f2d9ac00792839ed198f14d /commands
parentc2f4404fca15be37228545b1893f5fa335168337 (diff)
downloadaerc-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.go3
-rw-r--r--commands/msg/toggle-threads.go2
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()