cut and paste files

This commit is contained in:
Matt Parker
2025-10-21 21:37:06 +10:00
parent 0f259fa4c7
commit e47bebffca
3 changed files with 31 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ public partial class SolutionExplorerPanel
.OfType<RefCountedContainer<SharpIdeFile>>()
.Select(s => s.Item)
.ToList(),
ClipboardOperation.Copy);
clipboardOperation);
}
private List<TreeItem> GetSelectedTreeItems()
@@ -75,6 +75,14 @@ public partial class SolutionExplorerPanel
await _ideFileOperationsService.CopyFile(folderOrProject, fileToPaste.Path, fileToPaste.Name);
}
}
// This will blow up if cutting a file into a directory that already has a file with the same name, but I don't really want to handle renaming cut-pasted files for MVP
else if (operation is ClipboardOperation.Cut)
{
foreach (var fileToPaste in filesToPaste)
{
await _ideFileOperationsService.MoveFile(folderOrProject, fileToPaste);
}
}
});
}
}