diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-22 11:44:03 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | c2b154acad4e1040bdc0e09cf44733ccd877923b (patch) | |
tree | d963fb7f4cdb405c8dfa610c94835d5c00822498 /pkg/gui/quitting.go | |
parent | fbd61fcd17d495e9605bcf1f765663f861839cac (diff) |
better handling of our different modes and also cherry picking
Diffstat (limited to 'pkg/gui/quitting.go')
-rw-r--r-- | pkg/gui/quitting.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/pkg/gui/quitting.go b/pkg/gui/quitting.go index 6f1b77e29..da755c4dc 100644 --- a/pkg/gui/quitting.go +++ b/pkg/gui/quitting.go @@ -41,15 +41,10 @@ func (gui *Gui) handleTopLevelReturn(g *gocui.Gui, v *gocui.View) error { return gui.switchContext(currentContext.GetParentContext()) } - if gui.inDiffMode() { - return gui.exitDiffMode() - } - if gui.inFilterMode() { - return gui.exitFilterMode() - } - - if gui.GitCommand.PatchManager.Active() { - return gui.handleResetPatch() + for _, mode := range gui.modeStatuses() { + if mode.isActive() { + return mode.onReset() + } } if gui.Config.GetUserConfig().GetBool("quitOnTopLevelReturn") { |