summaryrefslogtreecommitdiffstats
path: root/pkg/gui/files_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-03-21 16:28:03 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-03-30 21:57:00 +1100
commit1629a7d2802bfd1becafde8b69cca513f300c330 (patch)
tree203e170b96082704340221b50f3df83deab435c1 /pkg/gui/files_panel.go
parentb5a51693721cd386d610cbe81834c3988446d987 (diff)
same for renames
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r--pkg/gui/files_panel.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 639f2327c..d14e1f6c8 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -534,6 +534,14 @@ func (gui *Gui) refreshStateFiles() error {
prevSelectedLineIdx := gui.State.Panels.Files.SelectedLineIdx
files := gui.GitCommand.GetStatusFiles(commands.GetStatusFileOptions{})
+
+ // for when you stage the old file of a rename and the new file is in a collapsed dir
+ for _, file := range files {
+ if selectedNode != nil && selectedNode.Path != "" && file.PreviousName == selectedNode.Path {
+ gui.State.FileChangeManager.ExpandToPath(file.Name)
+ }
+ }
+
gui.State.FileChangeManager.SetFiles(files)
if err := gui.fileWatcher.addFilesToFileWatcher(files); err != nil {