1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-23 21:51:07 +02:00

Explicitly refer confirmation panel view

as @jesseduffield pointed in , need to refer
confirmation panel view explicitly in case something
else has focus

Co-Authored-By: KOREAN139 <korean139@gmail.com>
This commit is contained in:
Jesse Duffield 2019-01-14 20:25:01 +09:00
parent 2dc5e6d503
commit a38d1a3b68

@ -54,7 +54,10 @@ func (gui *Gui) getMessageHeight(v *gocui.View, message string, width int) int {
func (gui *Gui) getConfirmationPanelDimensions(g *gocui.Gui, prompt string) (int, int, int, int) {
width, height := g.Size()
panelWidth := width / 2
view := g.CurrentView()
view, err := gui.g.View("confirmation")
if err != nil { // confirmation panel was deleted so we just return empty values
return 0,0,0,0
}
panelHeight := gui.getMessageHeight(view, prompt, panelWidth)
return width/2 - panelWidth/2,
height/2 - panelHeight/2 - panelHeight%2 - 1,