summaryrefslogtreecommitdiffstats
path: root/pkg/gui/files_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-03-21 16:23:05 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-03-30 21:57:00 +1100
commitb5a51693721cd386d610cbe81834c3988446d987 (patch)
tree7910192ca32b55739dae606c76abdb86ff9cb9d5 /pkg/gui/files_panel.go
parent4b4bfae4f491a1701932cf338711bcee41b989a8 (diff)
expand to path when switching to tree mode
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r--pkg/gui/files_panel.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 5c0ef9c64..639f2327c 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -848,6 +848,10 @@ func (gui *Gui) handleToggleFileTreeView() error {
gui.State.FileChangeManager.ToggleShowTree()
+ if path != "" {
+ gui.State.FileChangeManager.ExpandToPath(path)
+ }
+
// find that same node in the new format and move the cursor to it
if path != "" {
index, found := gui.State.FileChangeManager.GetIndexForPath(path)