1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

better logic for taking focus away from popup panels

This commit is contained in:
Jesse Duffield
2020-08-18 08:04:15 +10:00
parent 119d5be1a4
commit a12d18146c
5 changed files with 8 additions and 28 deletions

View File

@ -90,6 +90,13 @@ func (gui *Gui) switchContext(c Context) error {
// push onto stack
// if we are switching to a side context, remove all other contexts in the stack
if c.GetKind() == SIDE_CONTEXT {
for _, stackContext := range gui.State.ContextStack {
if stackContext.GetKey() != c.GetKey() {
if err := gui.deactivateContext(stackContext); err != nil {
return err
}
}
}
gui.State.ContextStack = []Context{c}
} else {
// TODO: think about other exceptional cases