msgstore: leave visual-mark mode after certain commands

Commit "4753cfd visual-mode: deselect messages after performing command"
introduced the behavior of leaving visual mark mode after performing
certain commands. Add this behavior to additional commands:

- Delete
- Archive
- Move

Remark the selected mail files if an error occurred during the
operation.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Tim Culverhouse 2022-07-31 09:41:20 -05:00 committed by Robin Jarry
parent db195bebf0
commit 56dabb5c9c
3 changed files with 7 additions and 0 deletions
commands/msg

View file

@ -44,6 +44,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
}
//caution, can be nil
next := findNextNonDeleted(uids, store)
store.ClearVisualMark()
store.Delete(uids, func(msg types.WorkerMessage) {
switch msg := msg.(type) {
case *types.Done:
@ -79,8 +80,10 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
}
acct.Messages().Invalidate()
case *types.Error:
store.Remark()
aerc.PushError(msg.Error.Error())
case *types.Unsupported:
store.Remark()
// notmuch doesn't support it, we want the user to know
aerc.PushError(" error, unsupported for this worker")
}