From 8ea86cea41aa038a25a8fee9cd540a7336869dae Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 30 Jan 2021 13:51:32 +0100 Subject: Get rid of the aerc.PushError(" " + $string) idiom The individual callers should not be responsible for padding --- widgets/aerc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'widgets/aerc.go') diff --git a/widgets/aerc.go b/widgets/aerc.go index 01166b0..6df0c95 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -429,11 +429,11 @@ func (aerc *Aerc) BeginExCommand(cmd string) { exline := NewExLine(aerc.conf, cmd, func(cmd string) { parts, err := shlex.Split(cmd) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) } err = aerc.cmd(parts) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) } // only add to history if this is an unsimulated command, // ie one not executed from a keybinding @@ -457,7 +457,7 @@ func (aerc *Aerc) RegisterPrompt(prompt string, cmd []string) { } err := aerc.cmd(cmd) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) } }, func(cmd string) []string { return nil // TODO: completions @@ -484,7 +484,7 @@ func (aerc *Aerc) RegisterChoices(choices []Choice) { } err := aerc.cmd(cmd) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) } }, func(cmd string) []string { return nil // TODO: completions -- cgit v1.2.3