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

more lenient handling of views not existing

This commit is contained in:
Jesse Duffield 2020-09-26 11:57:06 +10:00
parent 8dae54ab8c
commit 92183de29e

View File

@ -477,11 +477,13 @@ func (gui *Gui) activateContext(c Context) error {
gui.setViewTabForContext(c)
if _, err := gui.g.SetCurrentView(viewName); err != nil {
return err
// if view no longer exists, pop again
return gui.returnFromContext()
}
if _, err := gui.g.SetViewOnTop(viewName); err != nil {
return err
// if view no longer exists, pop again
return gui.returnFromContext()
}
// if the new context's view was previously displaying another context, render the new context