1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

ensure there is always a current context

This commit is contained in:
Jesse Duffield
2020-08-23 10:17:17 +10:00
parent ade54b38c1
commit 4198bbae6c
4 changed files with 5 additions and 16 deletions

View File

@ -493,20 +493,9 @@ func (gui *Gui) renderContextStack() string {
return result
}
func (gui *Gui) currentContextKey() string {
currentContext := gui.currentContext()
if currentContext == nil {
return ""
}
return currentContext.GetKey()
}
func (gui *Gui) currentContext() Context {
// on startup the stack can be empty so we'll return an empty string in that case
if len(gui.State.ContextStack) == 0 {
return nil
return gui.defaultSideContext()
}
return gui.State.ContextStack[len(gui.State.ContextStack)-1]