diff options
author | Mark Kopenga <mkopenga@gmail.com> | 2018-08-15 15:03:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-15 15:03:27 +0200 |
commit | 9112278ab751f2c5637a2fc74acb057be678be20 (patch) | |
tree | 2cff1033e34f5e1eac954545eabe0beec5e016cf /pkg/gui/confirmation_panel.go | |
parent | d00c46a7125180cdac01c5ff643d40fd2b06a293 (diff) | |
parent | 8d99b400fd9b5ba050e1c8f87b5427482bd50c7b (diff) |
Merge pull request #4 from jesseduffield/master
Update to latest master
Diffstat (limited to 'pkg/gui/confirmation_panel.go')
-rw-r--r-- | pkg/gui/confirmation_panel.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index 0a1cd0c5b..b34200e16 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -57,7 +57,7 @@ func (gui *Gui) getConfirmationPanelDimensions(g *gocui.Gui, prompt string) (int } func (gui *Gui) createPromptPanel(g *gocui.Gui, currentView *gocui.View, title string, handleConfirm func(*gocui.Gui, *gocui.View) error) error { - g.SetViewOnBottom("commitMessage") + gui.onNewPopupPanel() // only need to fit one line x0, y0, x1, y1 := gui.getConfirmationPanelDimensions(g, "") if confirmationView, err := g.SetView("confirmation", x0, y0, x1, y1, 0); err != nil { @@ -73,13 +73,17 @@ func (gui *Gui) createPromptPanel(g *gocui.Gui, currentView *gocui.View, title s return nil } +func (gui *Gui) onNewPopupPanel() { + gui.g.SetViewOnBottom("commitMessage") +} + func (gui *Gui) createConfirmationPanel(g *gocui.Gui, currentView *gocui.View, title, prompt string, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error { - g.SetViewOnBottom("commitMessage") + gui.onNewPopupPanel() g.Update(func(g *gocui.Gui) error { // delete the existing confirmation panel if it exists if view, _ := g.View("confirmation"); view != nil { if err := gui.closeConfirmationPrompt(g); err != nil { - panic(err) + gui.Log.Error("Could not close confirmation prompt: ", err.Error()) } } x0, y0, x1, y1 := gui.getConfirmationPanelDimensions(g, prompt) |