From 4080e9b501137543ea4234be285b51fe9b29cf6b Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 21 Aug 2020 21:08:06 +1000 Subject: [PATCH] only return focus if we already have it --- pkg/gui/patch_building_panel.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go index c39568cdf..d7be86857 100644 --- a/pkg/gui/patch_building_panel.go +++ b/pkg/gui/patch_building_panel.go @@ -82,7 +82,11 @@ func (gui *Gui) handleEscapePatchBuildingPanel() error { gui.GitCommand.PatchManager.Reset() } - return gui.switchContext(gui.Contexts.CommitFiles.Context) + if gui.currentContext().GetKey() == gui.Contexts.PatchBuilding.Context.GetKey() { + return gui.switchContext(gui.Contexts.CommitFiles.Context) + } + + return nil } func (gui *Gui) refreshSecondaryPatchPanel() error {