gofmt fixes
This commit is contained in:
parent
92f59ef94a
commit
6f8ad91824
|
@ -40,7 +40,7 @@ func (MakeDir) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
aerc.PushStatus("Directory created.", 10*time.Second)
|
aerc.PushStatus("Directory created.", 10*time.Second)
|
||||||
acct.Directories().Select(name)
|
acct.Directories().Select(name)
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -27,7 +27,7 @@ func (Choose) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
choices := []widgets.Choice{}
|
choices := []widgets.Choice{}
|
||||||
for i := 0; i+4 < len(args); i+=4 {
|
for i := 0; i+4 < len(args); i += 4 {
|
||||||
if args[i+1] != "-o" {
|
if args[i+1] != "-o" {
|
||||||
return chooseUsage(args[0])
|
return chooseUsage(args[0])
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
r.Close()
|
r.Close()
|
||||||
composer.Close()
|
composer.Close()
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
r.Close()
|
r.Close()
|
||||||
composer.Close()
|
composer.Close()
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ func (ExecCmd) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
go func() {
|
go func() {
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
aerc.PushError(" "+err.Error())
|
aerc.PushError(" " + err.Error())
|
||||||
} else {
|
} else {
|
||||||
color := tcell.ColorDefault
|
color := tcell.ColorDefault
|
||||||
if cmd.ProcessState.ExitCode() != 0 {
|
if cmd.ProcessState.ExitCode() != 0 {
|
||||||
|
|
|
@ -86,7 +86,7 @@ func (Archive) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
wg.Done()
|
wg.Done()
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
success = false
|
success = false
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ func (Copy) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
aerc.PushStatus("Messages copied.", 10*time.Second)
|
aerc.PushStatus("Messages copied.", 10*time.Second)
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -47,7 +47,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
aerc.PushStatus("Messages deleted.", 10*time.Second)
|
aerc.PushStatus("Messages deleted.", 10*time.Second)
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ func (ModifyLabels) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
aerc.PushStatus("labels updated", 10*time.Second)
|
aerc.PushStatus("labels updated", 10*time.Second)
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -71,7 +71,7 @@ func (Move) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
aerc.PushStatus("Message moved to "+joinedArgs, 10*time.Second)
|
aerc.PushStatus("Message moved to "+joinedArgs, 10*time.Second)
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -93,7 +93,7 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
}()
|
}()
|
||||||
err = ecmd.Run()
|
err = ecmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
aerc.PushError(" "+err.Error())
|
aerc.PushError(" " + err.Error())
|
||||||
} else {
|
} else {
|
||||||
color := tcell.ColorDefault
|
color := tcell.ColorDefault
|
||||||
if ecmd.ProcessState.ExitCode() != 0 {
|
if ecmd.ProcessState.ExitCode() != 0 {
|
||||||
|
|
|
@ -93,7 +93,7 @@ func submitReadChange(aerc *widgets.Aerc, store *lib.MessageStore,
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
aerc.PushStatus(msg_success, 10*time.Second)
|
aerc.PushStatus(msg_success, 10*time.Second)
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ func submitReadChangeWg(aerc *widgets.Aerc, store *lib.MessageStore,
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
wg.Done()
|
wg.Done()
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
aerc.PushError(" "+msg.Error.Error())
|
aerc.PushError(" " + msg.Error.Error())
|
||||||
*success = false
|
*success = false
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ func TermCore(aerc *widgets.Aerc, args []string) error {
|
||||||
term.OnClose = func(err error) {
|
term.OnClose = func(err error) {
|
||||||
aerc.RemoveTab(term)
|
aerc.RemoveTab(term)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
aerc.PushError(" "+err.Error())
|
aerc.PushError(" " + err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -414,7 +414,7 @@ func (wizard *AccountWizard) ConfigureTemporaryAccount(temporary bool) {
|
||||||
|
|
||||||
func (wizard *AccountWizard) errorFor(d ui.Interactive, err error) {
|
func (wizard *AccountWizard) errorFor(d ui.Interactive, err error) {
|
||||||
if d == nil {
|
if d == nil {
|
||||||
wizard.aerc.PushError(" "+err.Error())
|
wizard.aerc.PushError(" " + err.Error())
|
||||||
wizard.Invalidate()
|
wizard.Invalidate()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ func (wizard *AccountWizard) errorFor(d ui.Interactive, err error) {
|
||||||
wizard.step = step
|
wizard.step = step
|
||||||
wizard.focus = focus
|
wizard.focus = focus
|
||||||
wizard.Focus(true)
|
wizard.Focus(true)
|
||||||
wizard.aerc.PushError(" "+err.Error())
|
wizard.aerc.PushError(" " + err.Error())
|
||||||
wizard.Invalidate()
|
wizard.Invalidate()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -540,7 +540,7 @@ func (wizard *AccountWizard) finish(tutorial bool) {
|
||||||
term.OnClose = func(err error) {
|
term.OnClose = func(err error) {
|
||||||
wizard.aerc.RemoveTab(term)
|
wizard.aerc.RemoveTab(term)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wizard.aerc.PushError(" "+err.Error())
|
wizard.aerc.PushError(" " + err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -416,11 +416,11 @@ func (aerc *Aerc) BeginExCommand(cmd string) {
|
||||||
exline := NewExLine(aerc.conf, cmd, func(cmd string) {
|
exline := NewExLine(aerc.conf, cmd, func(cmd string) {
|
||||||
parts, err := shlex.Split(cmd)
|
parts, err := shlex.Split(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
aerc.PushError(" "+err.Error())
|
aerc.PushError(" " + err.Error())
|
||||||
}
|
}
|
||||||
err = aerc.cmd(parts)
|
err = aerc.cmd(parts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
aerc.PushError(" "+err.Error())
|
aerc.PushError(" " + err.Error())
|
||||||
}
|
}
|
||||||
// only add to history if this is an unsimulated command,
|
// only add to history if this is an unsimulated command,
|
||||||
// ie one not executed from a keybinding
|
// ie one not executed from a keybinding
|
||||||
|
@ -444,7 +444,7 @@ func (aerc *Aerc) RegisterPrompt(prompt string, cmd []string) {
|
||||||
}
|
}
|
||||||
err := aerc.cmd(cmd)
|
err := aerc.cmd(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
aerc.PushError(" "+err.Error())
|
aerc.PushError(" " + err.Error())
|
||||||
}
|
}
|
||||||
}, func(cmd string) []string {
|
}, func(cmd string) []string {
|
||||||
return nil // TODO: completions
|
return nil // TODO: completions
|
||||||
|
@ -458,7 +458,7 @@ func (aerc *Aerc) RegisterChoices(choices []Choice) {
|
||||||
for _, c := range choices {
|
for _, c := range choices {
|
||||||
text := fmt.Sprintf("[%s] %s", c.Key, c.Text)
|
text := fmt.Sprintf("[%s] %s", c.Key, c.Text)
|
||||||
if strings.Contains(c.Text, c.Key) {
|
if strings.Contains(c.Text, c.Key) {
|
||||||
text = strings.Replace(c.Text, c.Key, "[" + c.Key + "]", 1)
|
text = strings.Replace(c.Text, c.Key, "["+c.Key+"]", 1)
|
||||||
}
|
}
|
||||||
texts = append(texts, text)
|
texts = append(texts, text)
|
||||||
cmds[c.Key] = c.Command
|
cmds[c.Key] = c.Command
|
||||||
|
|
Loading…
Reference in New Issue