diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-03-04 14:43:20 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-03-04 15:07:48 +0100 |
commit | 723504a290ca208c5ee8dc67c86b69b98cfbd069 (patch) | |
tree | b2179df6d685d8fda94379c0b5f17caca0258a27 /pkg/gui/controllers | |
parent | 40a29fd622df85094f9982426437b30d0b603abc (diff) |
Keep side context in context stack when pushing a main context
This fixes accordion mode for the commit files panel. When entering a file, the
commit files panel should stay expanded.
Diffstat (limited to 'pkg/gui/controllers')
-rw-r--r-- | pkg/gui/controllers/helpers/patch_building_helper.go | 2 | ||||
-rw-r--r-- | pkg/gui/controllers/merge_conflicts_controller.go | 2 | ||||
-rw-r--r-- | pkg/gui/controllers/staging_controller.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/controllers/helpers/patch_building_helper.go b/pkg/gui/controllers/helpers/patch_building_helper.go index 25ac63a08..646a8f167 100644 --- a/pkg/gui/controllers/helpers/patch_building_helper.go +++ b/pkg/gui/controllers/helpers/patch_building_helper.go @@ -38,7 +38,7 @@ func (self *PatchBuildingHelper) ValidateNormalWorkingTreeState() (bool, error) // takes us from the patch building panel back to the commit files panel func (self *PatchBuildingHelper) Escape() error { - return self.c.PushContext(self.contexts.CommitFiles) + return self.c.PopContext() } // kills the custom patch and returns us back to the commit files panel if needed diff --git a/pkg/gui/controllers/merge_conflicts_controller.go b/pkg/gui/controllers/merge_conflicts_controller.go index 90da5283c..b35f846c2 100644 --- a/pkg/gui/controllers/merge_conflicts_controller.go +++ b/pkg/gui/controllers/merge_conflicts_controller.go @@ -162,7 +162,7 @@ func (self *MergeConflictsController) context() *context.MergeConflictsContext { } func (self *MergeConflictsController) Escape() error { - return self.c.PushContext(self.contexts.Files) + return self.c.PopContext() } func (self *MergeConflictsController) HandleEditFile() error { diff --git a/pkg/gui/controllers/staging_controller.go b/pkg/gui/controllers/staging_controller.go index 0a8ca5521..0cddfb841 100644 --- a/pkg/gui/controllers/staging_controller.go +++ b/pkg/gui/controllers/staging_controller.go @@ -133,7 +133,7 @@ func (self *StagingController) EditFile() error { } func (self *StagingController) Escape() error { - return self.c.PushContext(self.contexts.Files) + return self.c.PopContext() } func (self *StagingController) TogglePanel() error { |