浏览代码

Fixed folder renaming issue with case-only change

Brian Fiete 3 年之前
父节点
当前提交
1ce00ccf11
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      IDE/src/FileWatcher.bf

+ 13 - 0
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)
 			{