summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.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/gui.go
parentb882ac9e066bce21c18d73122005f06acfda3bfa (diff)
allow entering and returning from submodule
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 94634113b..d35fe59be 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -317,6 +317,10 @@ type guiState struct {
// Some views move between windows for example the commitFiles view and when cycling through
// side windows we need to know which view to give focus to for a given window
WindowViewNameMap map[string]string
+
+ // when you enter into a submodule we'll append the superproject's path to this array
+ // so that you can return to the superproject
+ RepoPathStack []string
}
func (gui *Gui) resetState() {
@@ -329,10 +333,12 @@ func (gui *Gui) resetState() {
CherryPickedCommits: make([]*commands.Commit, 0),
ContextKey: "",
}
+ prevRepoPathStack := []string{}
if gui.State != nil {
prevFiltering = gui.State.Modes.Filtering
prevDiff = gui.State.Modes.Diffing
prevCherryPicking = gui.State.Modes.CherryPicking
+ prevRepoPathStack = gui.State.RepoPathStack
}
modes := Modes{
@@ -371,6 +377,7 @@ func (gui *Gui) resetState() {
Ptmx: nil,
Modes: modes,
ViewContextMap: gui.initialViewContextMap(),
+ RepoPathStack: prevRepoPathStack,
}
}