mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-22 05:29:44 +02:00
Merge pull request #2481 from stefanhaller/fix-accordion-mode-for-custom-patch
This commit is contained in:
commit
3791b5057a
@ -78,12 +78,15 @@ func (gui *Gui) pushToContextStack(c types.Context) []types.Context {
|
||||
gui.State.ContextManager.ContextStack = []types.Context{c}
|
||||
} else if c.GetKind() == types.MAIN_CONTEXT {
|
||||
// if we're switching to a main context, remove all other main contexts in the stack
|
||||
contextsToKeep := []types.Context{}
|
||||
for _, stackContext := range gui.State.ContextManager.ContextStack {
|
||||
if stackContext.GetKind() == types.MAIN_CONTEXT {
|
||||
contextsToDeactivate = append(contextsToDeactivate, stackContext)
|
||||
} else {
|
||||
contextsToKeep = append(contextsToKeep, stackContext)
|
||||
}
|
||||
}
|
||||
gui.State.ContextManager.ContextStack = []types.Context{c}
|
||||
gui.State.ContextManager.ContextStack = append(contextsToKeep, c)
|
||||
} else {
|
||||
topContext := gui.currentContextWithoutLock()
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user