aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/delete.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-08-08 22:21:41 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-22 09:30:37 +0200
commitcfc19a7ec22a1c60f79427ddbabdf437705efbab (patch)
treefbc4d54f9edb082ff87c84f864df17514c8e34da /commands/msg/delete.go
parentee961d3b1d5ef412b3daf0ef0b8c18ac8957b365 (diff)
downloadaerc-cfc19a7ec22a1c60f79427ddbabdf437705efbab.tar.gz
store: extract marking behavior and add tests
Separate the marking functions from the message store and extract the marking behavior into its own class with tests. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg/delete.go')
-rw-r--r--commands/msg/delete.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/commands/msg/delete.go b/commands/msg/delete.go
index ceb570b3..9db850ec 100644
--- a/commands/msg/delete.go
+++ b/commands/msg/delete.go
@@ -43,9 +43,10 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
return err
}
sel := store.Selected()
+ marker := store.Marker()
+ marker.ClearVisualMark()
// caution, can be nil
next := findNextNonDeleted(uids, store)
- store.ClearVisualMark()
store.Delete(uids, func(msg types.WorkerMessage) {
switch msg := msg.(type) {
case *types.Done:
@@ -80,11 +81,11 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
}
}
case *types.Error:
- store.Remark()
+ marker.Remark()
store.Select(sel.Uid)
aerc.PushError(msg.Error.Error())
case *types.Unsupported:
- store.Remark()
+ marker.Remark()
store.Select(sel.Uid)
// notmuch doesn't support it, we want the user to know
aerc.PushError(" error, unsupported for this worker")