From 1629a7d2802bfd1becafde8b69cca513f300c330 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 21 Mar 2021 16:28:03 +1100 Subject: [PATCH] same for renames --- pkg/gui/files_panel.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 {