diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 09:02:44 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 18:21:59 +1000 |
commit | 914fb361732c116b3db6bd47bd9d08bb9f15a608 (patch) | |
tree | 57284367b095f1c895573bcc0f5def3def7238ea /pkg/gui/files_panel.go | |
parent | b882ac9e066bce21c18d73122005f06acfda3bfa (diff) |
allow entering and returning from submodule
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r-- | pkg/gui/files_panel.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index c57f94082..26ec38bc5 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -8,6 +8,7 @@ import ( // "strings" "fmt" + "os" "regexp" "strings" @@ -159,6 +160,17 @@ func (gui *Gui) enterFile(forceSecondaryFocused bool, selectedLineIdx int) error return nil } + submoduleConfigs := gui.State.SubmoduleConfigs + if file.IsSubmodule(submoduleConfigs) { + wd, err := os.Getwd() + if err != nil { + return err + } + gui.State.RepoPathStack = append(gui.State.RepoPathStack, wd) + submoduleConfig := file.SubmoduleConfig(submoduleConfigs) + return gui.dispatchSwitchToRepo(submoduleConfig.Path) + } + if file.HasInlineMergeConflicts { return gui.handleSwitchToMerge() } |