mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
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.
This commit is contained in:
parent
a7a0606548
commit
2b4ccbf853
2 changed files with 6 additions and 1 deletions
|
@ -29,7 +29,11 @@ func (self *PatchBuildingHelper) ValidateNormalWorkingTreeState() (bool, error)
|
||||||
|
|
||||||
// takes us from the patch building panel back to the commit files panel
|
// takes us from the patch building panel back to the commit files panel
|
||||||
func (self *PatchBuildingHelper) Escape() {
|
func (self *PatchBuildingHelper) Escape() {
|
||||||
self.c.Context().Pop()
|
if parentCtx := self.c.Contexts().CustomPatchBuilder.GetParentContext(); parentCtx != nil {
|
||||||
|
self.c.Context().Push(parentCtx, types.OnFocusOpts{})
|
||||||
|
} else {
|
||||||
|
self.c.Context().Pop()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// kills the custom patch and returns us back to the commit files panel if needed
|
// kills the custom patch and returns us back to the commit files panel if needed
|
||||||
|
|
|
@ -81,6 +81,7 @@ func (self *SwitchToDiffFilesController) GetOnClickFocusedMainView() func(mainVi
|
||||||
context.GetViewTrait().FocusPoint(
|
context.GetViewTrait().FocusPoint(
|
||||||
context.ModelIndexToViewIndex(idx))
|
context.ModelIndexToViewIndex(idx))
|
||||||
node = context.GetSelected()
|
node = context.GetSelected()
|
||||||
|
self.c.Contexts().CustomPatchBuilder.SetParentContext(self.context)
|
||||||
return self.c.Helpers().CommitFiles.EnterCommitFile(node, types.OnFocusOpts{ClickedWindowName: "main", ClickedViewLineIdx: line, ClickedViewRealLineIdx: line})
|
return self.c.Helpers().CommitFiles.EnterCommitFile(node, types.OnFocusOpts{ClickedWindowName: "main", ClickedViewLineIdx: line, ClickedViewRealLineIdx: line})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue