aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/move.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/move.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/move.go')
-rw-r--r--commands/msg/move.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/msg/move.go b/commands/msg/move.go
index 6eca6675..13b1fb7b 100644
--- a/commands/msg/move.go
+++ b/commands/msg/move.go
@@ -54,7 +54,8 @@ func (Move) Execute(aerc *widgets.Aerc, args []string) error {
if isMsgView {
aerc.RemoveTab(h.msgProvider)
}
- store.ClearVisualMark()
+ marker := store.Marker()
+ marker.ClearVisualMark()
findNextNonDeleted(uids, store)
joinedArgs := strings.Join(args[optind:], " ")
store.Move(uids, joinedArgs, createParents, func(
@@ -64,7 +65,7 @@ func (Move) Execute(aerc *widgets.Aerc, args []string) error {
case *types.Done:
aerc.PushStatus("Message moved to "+joinedArgs, 10*time.Second)
case *types.Error:
- store.Remark()
+ marker.Remark()
aerc.PushError(msg.Error.Error())
}
})