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

This commit is contained in:
Benjamin Pasero 2016-08-08 09:17:23 +02:00
parent e8014cc48d
commit ee55203ad4

View file

@ -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, '&&');
}