summaryrefslogtreecommitdiffstats
path: root/pkg/gui/filetree
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/filetree
parent4b4bfae4f491a1701932cf338711bcee41b989a8 (diff)
expand to path when switching to tree mode
Diffstat (limited to 'pkg/gui/filetree')
-rw-r--r--pkg/gui/filetree/file_change_manager.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/gui/filetree/file_change_manager.go b/pkg/gui/filetree/file_change_manager.go
index fa68458af..30bd7cf1e 100644
--- a/pkg/gui/filetree/file_change_manager.go
+++ b/pkg/gui/filetree/file_change_manager.go
@@ -2,6 +2,7 @@ package filetree
import (
"fmt"
+ "os"
"strings"
"github.com/jesseduffield/lazygit/pkg/commands/models"
@@ -141,3 +142,12 @@ func (m *FileChangeManager) renderAux(s *FileChangeNode, prefix string, depth in
return arr
}
+
+func (m *FileChangeManager) ExpandToPath(path string) {
+ // need every directory along the way
+ split := strings.Split(path, string(os.PathSeparator))
+ for i := range split {
+ dir := strings.Join(split[0:i+1], string(os.PathSeparator))
+ m.collapsedPaths[dir] = false
+ }
+}