Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #47852 #56775

Merged
merged 1 commit into from Aug 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -871,12 +871,15 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop {
return true; // Can not move anything onto itself
}

if (!isCopy && resources.dirname(source.resource).toString() === target.resource.toString()) {
return true; // Can not move a file to the same parent unless we copy
}
// If we are not moving workspace root folders
if (!(source.isRoot && target instanceof ExplorerItem && target.isRoot)) {
if (!isCopy && resources.dirname(source.resource).toString() === target.resource.toString()) {
return true; // Can not move a file to the same parent unless we copy
}

if (resources.isEqualOrParent(target.resource, source.resource, !isLinux /* ignorecase */)) {
return true; // Can not move a parent folder into one of its children
if (resources.isEqualOrParent(target.resource, source.resource, !isLinux /* ignorecase */)) {
return true; // Can not move a parent folder into one of its children
}
}

return false;
Expand Down