diff options
author | inwit <inwit@sindominio.net> | 2023-11-07 18:28:56 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-11-12 12:53:11 +0100 |
commit | 2d589766d03ae7ccbd9a360e51e246e35afe394a (patch) | |
tree | 1f37381d2196b8872ca95fda643cf6ab53ded582 /commands/msg/copy.go | |
parent | c13df799763c6b584cf4963e125361bb16c0e07d (diff) | |
download | aerc-2d589766d03ae7ccbd9a360e51e246e35afe394a.tar.gz |
ui: correct some push status messages
Upon success, commands :delete, :copy, :archive and :move show "Messages
deleted/copied/archived/moved" in the status bar, which is obviously
wrong if they are acting upon only one message. Make the success
notification for those commands explicitly agree with the actual number
of messages.
Signed-Off-By: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg/copy.go')
-rw-r--r-- | commands/msg/copy.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/commands/msg/copy.go b/commands/msg/copy.go index 77c9ade1..f91d885b 100644 --- a/commands/msg/copy.go +++ b/commands/msg/copy.go @@ -1,6 +1,7 @@ package msg import ( + "fmt" "time" "git.sr.ht/~rjarry/aerc/app" @@ -41,7 +42,13 @@ func (c Copy) Execute(args []string) error { ) { switch msg := msg.(type) { case *types.Done: - app.PushStatus("Messages copied.", 10*time.Second) + var s string + if len(uids) > 1 { + s = "%d messages copied to %s" + } else { + s = "%d message copied to %s" + } + app.PushStatus(fmt.Sprintf(s, len(uids), c.Folder), 10*time.Second) store.Marker().ClearVisualMark() case *types.Error: app.PushError(msg.Error.Error()) |