提交 ee55203a 编写于 作者: B Benjamin Pasero

File -> Open Recent menu shows paths containing "&" wrong (fixes #10049)

上级 e8014cc4
......@@ -453,7 +453,7 @@ export class VSCodeMenu {
private createOpenRecentMenuItem(path: string): Electron.MenuItem {
return new MenuItem({
label: path, click: () => {
label: unMnemonicLabel(path), click: () => {
let success = !!this.windowsService.open({ cli: this.envService.cliArgs, pathsToOpen: [path] });
if (!success) {
this.removeFromOpenedPathsList(path);
......@@ -861,8 +861,16 @@ function __separator__(): Electron.MenuItem {
function mnemonicLabel(label: string): string {
if (platform.isMacintosh) {
return label.replace(/\(&&\w\)|&&/g, ''); // no mnemonic support on mac/linux
return label.replace(/\(&&\w\)|&&/g, ''); // no mnemonic support on mac
}
return label.replace(/&&/g, '&');
}
function unMnemonicLabel(label: string): string {
if (platform.isMacintosh) {
return label; // no mnemonic support on mac
}
return label.replace(/&/g, '&&');
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册