提交 43131f07 编写于 作者: I isidor

Some open editors do not have a resource so use the name as drag identifier instead

fixes #7021
上级 1e6fdb8c
......@@ -471,8 +471,13 @@ export class DragAndDrop extends treedefaults.DefaultDragAndDrop {
}
public getDragURI(tree: ITree, element: OpenEditor): string {
const resource = element instanceof OpenEditor ? element.getResource() : null;
return resource ? resource.toString() : null;
if (!(element instanceof OpenEditor)) {
return null;
}
const resource = element.getResource();
// Some open editors do not have a resource (markdown preview) so use the name as drag identifier instead #7021
return resource ? resource.toString() : element.editorInput.getName();
}
public onDragOver(tree: ITree, data: IDragAndDropData, target: OpenEditor|EditorGroup, originalEvent: DragMouseEvent): IDragOverReaction {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册