1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-12 04:23:03 +02:00

same for renames

This commit is contained in:
Jesse Duffield 2021-03-21 16:28:03 +11:00
parent b5a5169372
commit 1629a7d280

View File

@ -534,6 +534,14 @@ func (gui *Gui) refreshStateFiles() error {
prevSelectedLineIdx := gui.State.Panels.Files.SelectedLineIdx prevSelectedLineIdx := gui.State.Panels.Files.SelectedLineIdx
files := gui.GitCommand.GetStatusFiles(commands.GetStatusFileOptions{}) 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) gui.State.FileChangeManager.SetFiles(files)
if err := gui.fileWatcher.addFilesToFileWatcher(files); err != nil { if err := gui.fileWatcher.addFilesToFileWatcher(files); err != nil {