1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-03-14 03:16:22 +01:00
aerc/commands/repeat.go
Francesc Elies 24f1bb61ec commands: add :repeat
Add a new :repeat command that will:

- Repeat the last executed command (:)
- If last command was :repeat, it will continue searching for the
  last non :repeat command, to avoid getting caught in an infinite loop.
- It won't repeat commands executed via keybinds defined in `binds.conf`

Changelog-added: New `:repeat` command.
Signed-off-by: Francesc Elies <elies@posteo.net>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2026-03-07 19:48:38 +01:00

27 lines
410 B
Go

package commands
import (
"git.sr.ht/~rjarry/aerc/app"
)
type Repeat struct{}
func init() {
Register(Repeat{})
}
func (Repeat) Description() string {
return "Repeat aerc's last executed command."
}
func (Repeat) Context() CommandContext {
return GLOBAL
}
func (Repeat) Aliases() []string {
return []string{"repeat"}
}
func (Repeat) Execute(args []string) error {
return app.ExecuteLastCommand()
}