1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-24 08:52:21 +02:00

more fixing

This commit is contained in:
Jesse Duffield 2018-05-26 16:08:18 +10:00
parent 06713f608b
commit 843927dd26
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,6 @@ func handleCommitPress(g *gocui.Gui, currentView *gocui.View) error {
return nil
}
maxX, maxY := g.Size()
// var v *gocui.View
if v, err := g.SetView("commit", maxX/2-30, maxY/2-1, maxX/2+30, maxY/2+1); err != nil {
if err != gocui.ErrUnknownView {
return err
@ -51,7 +50,9 @@ func handleCommitSubmit(g *gocui.Gui, v *gocui.View) error {
func closeCommitPrompt(g *gocui.Gui, v *gocui.View) error {
filesView, _ := g.View("files")
switchFocus(g, v, filesView)
// not passing in the view as oldView to switchFocus because we don't want a
// reference pointing to a deleted view
switchFocus(g, nil, filesView)
devLog("test prompt close")
if err := g.DeleteView("commit"); err != nil {
return err

View File

@ -24,9 +24,8 @@ func returnFocus(g *gocui.Gui, v *gocui.View) error {
func switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error {
if oldView != nil {
oldView.Highlight = false
devLog("setting previous view to ")
devLog("setting previous view to:", oldView.Name())
state.PreviousView = oldView.Name()
devLog(state.PreviousView)
}
newView.Highlight = true
devLog(newView.Name())