diff options
author | mjarkk <mkopenga@gmail.com> | 2018-10-20 18:58:37 +0200 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2018-10-20 18:58:37 +0200 |
commit | b72841ca0cfd5f08f8352c4c597468bed715aff9 (patch) | |
tree | 688bd0d895431bb6be5b1e633aef4341b2d8347d /pkg/gui | |
parent | 12425f0aa760759d916ef16bbd028b2c2de5577b (diff) |
Fixed golangcibot surgestions
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/commit_message_panel.go | 40 | ||||
-rw-r--r-- | pkg/gui/gui.go | 5 |
2 files changed, 34 insertions, 11 deletions
diff --git a/pkg/gui/commit_message_panel.go b/pkg/gui/commit_message_panel.go index 329ccec62..39818a848 100644 --- a/pkg/gui/commit_message_panel.go +++ b/pkg/gui/commit_message_panel.go @@ -58,6 +58,8 @@ var waitForGroupActie = false // waitForPassUname wait for a username or password input from the pushPassUname popup func (gui *Gui) waitForPassUname(g *gocui.Gui, currentView *gocui.View, passOrUname string) string { + waitForGroupActie = true + waitForGroup.Add(1) pushPassUnameView := gui.getPushPassUnameView(g) if passOrUname == "username" { pushPassUnameView.Title = gui.Tr.SLocalize("PushUsername") @@ -67,15 +69,18 @@ func (gui *Gui) waitForPassUname(g *gocui.Gui, currentView *gocui.View, passOrUn pushPassUnameView.Mask = '*' } g.Update(func(g *gocui.Gui) error { - g.SetViewOnTop("pushPassUname") - gui.switchFocus(g, currentView, pushPassUnameView) + _, err := g.SetViewOnTop("pushPassUname") + if err != nil { + return err + } + err = gui.switchFocus(g, currentView, pushPassUnameView) + if err != nil { + return err + } gui.RenderCommitLength() return nil }) - waitForGroupActie = true - waitForGroup.Add(1) waitForGroup.Wait() - return unamePassMessage } @@ -85,16 +90,31 @@ func (gui *Gui) handlePushConfirm(g *gocui.Gui, v *gocui.View) error { if waitForGroupActie { defer waitForGroup.Done() } - gui.refreshFiles(g) + err := gui.refreshFiles(g) + if err != nil { + return err + } v.Clear() - v.SetCursor(0, 0) - g.SetViewOnBottom("pushPassUname") - gui.switchFocus(g, v, gui.getFilesView(g)) + err = v.SetCursor(0, 0) + if err != nil { + return err + } + _, err = g.SetViewOnBottom("pushPassUname") + if err != nil { + return err + } + err = gui.switchFocus(g, v, gui.getFilesView(g)) + if err != nil { + return err + } return gui.refreshCommits(g) } func (gui *Gui) handlePushClose(g *gocui.Gui, v *gocui.View) error { - g.SetViewOnBottom("pushPassUname") + _, err := g.SetViewOnBottom("pushPassUname") + if err != nil { + return err + } unamePassMessage = "" if waitForGroupActie { defer waitForGroup.Done() diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 2baf354c0..681601d00 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -274,7 +274,10 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err != gocui.ErrUnknownView { return err } - g.SetViewOnBottom("pushPassUname") + _, err := g.SetViewOnBottom("pushPassUname") + if err != nil { + return err + } pushPassUnameView.Title = gui.Tr.SLocalize("PushUsername") pushPassUnameView.FgColor = gocui.ColorWhite pushPassUnameView.Editable = true |