提交 bb519ce1 编写于 作者: A Alex Ross

Fix \ on Windows in simple file picker

Fixes https://github.com/microsoft/vscode-remote-release/issues/1596
上级 5d182a4e
......@@ -514,6 +514,16 @@ export class SimpleFileDialog {
return undefined;
}
private root(value: URI) {
let lastDir = value;
let dir = resources.dirname(value);
while (!resources.isEqual(lastDir, dir)) {
lastDir = dir;
dir = resources.dirname(dir);
}
return dir;
}
private async tryUpdateItems(value: string, valueUri: URI): Promise<UpdateResult> {
if ((value.length > 0) && ((value[value.length - 1] === '~') || (value[0] === '~'))) {
let newDir = this.userHome;
......@@ -522,6 +532,11 @@ export class SimpleFileDialog {
}
await this.updateItems(newDir, true);
return UpdateResult.Updated;
} else if (value === '\\') {
valueUri = this.root(this.currentFolder);
value = this.pathFromUri(valueUri);
await this.updateItems(valueUri, true);
return UpdateResult.Updated;
} else if (!resources.isEqual(this.currentFolder, valueUri, true) && (this.endsWithSlash(value) || (!resources.isEqual(this.currentFolder, resources.dirname(valueUri), true) && resources.isEqualOrParent(this.currentFolder, resources.dirname(valueUri), true)))) {
let stat: IFileStat | undefined;
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册