1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-19 12:12:42 +02:00

honour options menu press

This commit is contained in:
Jesse Duffield 2021-09-25 13:21:28 +10:00
parent bd67bba751
commit 652c97d239
2 changed files with 27 additions and 23 deletions

View File

@ -128,6 +128,13 @@ func (gui *Gui) pushContextWithView(viewName string) error {
func (gui *Gui) returnFromContext() error {
gui.g.Update(func(*gocui.Gui) error {
return gui.returnFromContextSync()
})
return nil
}
func (gui *Gui) returnFromContextSync() error {
gui.State.ContextManager.Lock()
if len(gui.State.ContextManager.ContextStack) == 1 {
@ -150,9 +157,6 @@ func (gui *Gui) returnFromContext() error {
}
return gui.activateContext(newContext)
})
return nil
}
func (gui *Gui) deactivateContext(c Context) error {

View File

@ -43,7 +43,7 @@ func (gui *Gui) getMenuOptions() map[string]string {
}
func (gui *Gui) handleMenuClose() error {
return gui.returnFromContext()
return gui.returnFromContextSync()
}
type createMenuOptions struct {