diff --git a/plugins/vscode/src/files.ts b/plugins/vscode/src/files.ts index 2681de7..0965386 100644 --- a/plugins/vscode/src/files.ts +++ b/plugins/vscode/src/files.ts @@ -32,8 +32,8 @@ export async function GetFiles(path: string) { let data = JSON.parse(res) as Recent; return data.entries.map((file) => { - if (typeof file === "string") return decodeURIComponent(file); + if (typeof file === "string") return file; let path = file.fileUri || file.folderUri || file.workspace.configPath; - return decodeURIComponent(path); + return path; }); } diff --git a/plugins/vscode/src/vscode.ts b/plugins/vscode/src/vscode.ts index bc619a1..2d7ccdf 100644 --- a/plugins/vscode/src/vscode.ts +++ b/plugins/vscode/src/vscode.ts @@ -74,12 +74,14 @@ export class VSCode implements Plugin { }); }); - let items = files.map((file: any): ListItem => { - let item = new ListItem(basename(file), file); - let ext = file.includes("remote") ? ".remote" : extname(file); - item.icon = this.getIcon(ext); - return item; - }); + let items = files.map( + (file: any): ListItem => { + let item = new ListItem(basename(decodeURIComponent(file)), file); + let ext = file.includes("remote") ? ".remote" : extname(file); + item.icon = this.getIcon(ext); + return item; + } + ); if (!word.trim()) { let collects = this.getCollect(); @@ -163,7 +165,7 @@ export class VSCode implements Plugin { this.execCmd(cmd, { timeout: timeout, windowsHide: true, - encoding: "utf-8" + encoding: "utf-8", }) .then(() => { utools.hideMainWindow();