From 76a91813d8dc0f0011202f8120fc197097f022aa Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 28 May 2020 10:32:32 -0400 Subject: Revert "Remove duration from the status methods" This reverts commit f06d683688e3d2139b14f67b7e349089e7200bf4. --- widgets/aerc.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'widgets/aerc.go') diff --git a/widgets/aerc.go b/widgets/aerc.go index 47d7cc29..57d6cef9 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -386,16 +386,16 @@ func (aerc *Aerc) SetError(status string) *StatusMessage { return aerc.statusline.SetError(status) } -func (aerc *Aerc) PushStatus(text string) *StatusMessage { - return aerc.statusline.Push(text, 10*time.Second) +func (aerc *Aerc) PushStatus(text string, expiry time.Duration) *StatusMessage { + return aerc.statusline.Push(text, expiry) } -func (aerc *Aerc) PushError(text string) *StatusMessage { - return aerc.statusline.PushError(text, 10*time.Second) +func (aerc *Aerc) PushError(text string, expiry time.Duration) *StatusMessage { + return aerc.statusline.PushError(text, expiry) } -func (aerc *Aerc) PushSuccess(text string) *StatusMessage { - return aerc.statusline.PushSuccess(text, 10*time.Second) +func (aerc *Aerc) PushSuccess(text string, expiry time.Duration) *StatusMessage { + return aerc.statusline.PushSuccess(text, expiry) } func (aerc *Aerc) focus(item ui.Interactive) { @@ -424,11 +424,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(), 10*time.Second) } err = aerc.cmd(parts) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(" "+err.Error(), 10*time.Second) } // only add to history if this is an unsimulated command, // ie one not executed from a keybinding @@ -452,7 +452,7 @@ func (aerc *Aerc) RegisterPrompt(prompt string, cmd []string) { } err := aerc.cmd(cmd) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(" "+err.Error(), 10*time.Second) } }, func(cmd string) []string { return nil // TODO: completions @@ -479,7 +479,7 @@ func (aerc *Aerc) RegisterChoices(choices []Choice) { } err := aerc.cmd(cmd) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(" "+err.Error(), 10*time.Second) } }, func(cmd string) []string { return nil // TODO: completions -- cgit