mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-21 22:43:27 +02:00
do not double-append contexts to the stack
This commit is contained in:
parent
b1cda65dcf
commit
02f45b679f
@ -416,7 +416,10 @@ func (gui *Gui) pushContextDirect(c Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gui.State.ContextManager.ContextStack = []Context{c}
|
gui.State.ContextManager.ContextStack = []Context{c}
|
||||||
} else {
|
} else if len(gui.State.ContextManager.ContextStack) == 0 || gui.State.ContextManager.ContextStack[len(gui.State.ContextManager.ContextStack)-1].GetKey() != c.GetKey() {
|
||||||
|
// Do not append if the one at the end is the same context (e.g. opening a menu from a menu)
|
||||||
|
// In that case we'll just close the menu entirely when the user hits escape.
|
||||||
|
|
||||||
// TODO: think about other exceptional cases
|
// TODO: think about other exceptional cases
|
||||||
gui.State.ContextManager.ContextStack = append(gui.State.ContextManager.ContextStack, c)
|
gui.State.ContextManager.ContextStack = append(gui.State.ContextManager.ContextStack, c)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user