summaryrefslogtreecommitdiffstats
path: root/pkg/gui/quitting.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-29 09:02:44 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 18:21:59 +1000
commit914fb361732c116b3db6bd47bd9d08bb9f15a608 (patch)
tree57284367b095f1c895573bcc0f5def3def7238ea /pkg/gui/quitting.go
parentb882ac9e066bce21c18d73122005f06acfda3bfa (diff)
allow entering and returning from submodule
Diffstat (limited to 'pkg/gui/quitting.go')
-rw-r--r--pkg/gui/quitting.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/gui/quitting.go b/pkg/gui/quitting.go
index d53971ba3..34df87e92 100644
--- a/pkg/gui/quitting.go
+++ b/pkg/gui/quitting.go
@@ -49,6 +49,18 @@ func (gui *Gui) handleTopLevelReturn(g *gocui.Gui, v *gocui.View) error {
}
}
+
+ repoPathStack := gui.State.RepoPathStack
+ if len(repoPathStack) > 0 {
+ n := len(repoPathStack) - 1
+
+ path := repoPathStack[n]
+
+ gui.State.RepoPathStack = repoPathStack[:n]
+
+ return gui.dispatchSwitchToRepo(path)
+ }
+
if gui.Config.GetUserConfig().GetBool("quitOnTopLevelReturn") {
return gui.handleQuit()
}