Skip to content

Commit f104a15

Browse files
committed
WIP After going straight to patch building from main view, esc goes all the way back out
I *think* I like it better this way, but it needs more testing.
1 parent 7cc322c commit f104a15

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/gui/controllers/helpers/patch_building_helper.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ func (self *PatchBuildingHelper) ValidateNormalWorkingTreeState() (bool, error)
2929

3030
// takes us from the patch building panel back to the commit files panel
3131
func (self *PatchBuildingHelper) Escape() {
32-
self.c.Context().Pop()
32+
if parentCtx := self.c.Contexts().CustomPatchBuilder.GetParentContext(); parentCtx != nil {
33+
self.c.Context().Push(parentCtx, types.OnFocusOpts{})
34+
} else {
35+
self.c.Context().Pop()
36+
}
3337
}
3438

3539
// kills the custom patch and returns us back to the commit files panel if needed

pkg/gui/controllers/switch_to_diff_files_controller.go

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func (self *SwitchToDiffFilesController) GetOnClickFocusedMainView() func(mainVi
8181
context.GetViewTrait().FocusPoint(
8282
context.ModelIndexToViewIndex(idx))
8383
node = context.GetSelected()
84+
self.c.Contexts().CustomPatchBuilder.SetParentContext(self.context)
8485
return self.c.Helpers().CommitFiles.EnterCommitFile(node, types.OnFocusOpts{ClickedWindowName: "main", ClickedViewLineIdx: line, ClickedViewRealLineIdx: line})
8586
}
8687
}

0 commit comments

Comments
 (0)