mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-27 00:51:18 +02:00
escape patch building mode on hitting escape at the top level
This commit is contained in:
@ -35,6 +35,12 @@ func (gui *Gui) handleQuit() error {
|
||||
}
|
||||
|
||||
func (gui *Gui) handleTopLevelReturn(g *gocui.Gui, v *gocui.View) error {
|
||||
currentContext := gui.currentContext()
|
||||
if currentContext != nil && currentContext.GetParentContext() != nil {
|
||||
// TODO: think about whether this should be marked as a return rather than adding to the stack
|
||||
return gui.switchContext(currentContext.GetParentContext())
|
||||
}
|
||||
|
||||
if gui.inDiffMode() {
|
||||
return gui.exitDiffMode()
|
||||
}
|
||||
@ -42,10 +48,8 @@ func (gui *Gui) handleTopLevelReturn(g *gocui.Gui, v *gocui.View) error {
|
||||
return gui.exitFilterMode()
|
||||
}
|
||||
|
||||
currentContext := gui.currentContext()
|
||||
if currentContext != nil && currentContext.GetParentContext() != nil {
|
||||
// TODO: think about whether this should be marked as a return rather than adding to the stack
|
||||
gui.switchContext(currentContext.GetParentContext())
|
||||
if gui.GitCommand.PatchManager.Active() {
|
||||
return gui.handleResetPatch()
|
||||
}
|
||||
|
||||
if gui.Config.GetUserConfig().GetBool("quitOnTopLevelReturn") {
|
||||
|
Reference in New Issue
Block a user