From 1ce00ccf11f6f5d47bc99e01848a1f49ad52e481 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 28 Jul 2022 09:04:00 -0400 Subject: [PATCH] Fixed folder renaming issue with case-only change --- IDE/src/FileWatcher.bf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/IDE/src/FileWatcher.bf b/IDE/src/FileWatcher.bf index 63401fce..ba9a3286 100644 --- a/IDE/src/FileWatcher.bf +++ b/IDE/src/FileWatcher.bf @@ -95,6 +95,19 @@ namespace IDE FileChanged(starPath, null, .Changed); } + if ((isDirectory) && (changeType == .Renamed)) + { + if (filePath.Equals(newPath, .OrdinalIgnoreCase)) + { + // On Windows, renaming a directory with only case changes will result in a remove before a rename + var dirName = scope String(); + Path.GetDirectoryPath(newPath.Substring(0, newPath.Length - 1), dirName); + dirName.Append(Path.DirectorySeparatorChar); + + FileChanged(dirName, newPath, .DirectoryCreated); + } + } + var newPath; if (isDirectory) {