mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-25 22:01:14 +02:00
Explicitly refer confirmation panel view
as @jesseduffield pointed in #358, 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:
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) {
|
func (gui *Gui) getConfirmationPanelDimensions(g *gocui.Gui, prompt string) (int, int, int, int) {
|
||||||
width, height := g.Size()
|
width, height := g.Size()
|
||||||
panelWidth := width / 2
|
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)
|
panelHeight := gui.getMessageHeight(view, prompt, panelWidth)
|
||||||
return width/2 - panelWidth/2,
|
return width/2 - panelWidth/2,
|
||||||
height/2 - panelHeight/2 - panelHeight%2 - 1,
|
height/2 - panelHeight/2 - panelHeight%2 - 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user