File -> Open Recent menu shows paths containing "&" wrong (fixes #10049)
This commit is contained in:
parent
e8014cc48d
commit
ee55203ad4
|
@ -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, '&&');
|
||||
}
|
Loading…
Reference in a new issue