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

same solution on all OS (for #14622)

上级 239b199f
...@@ -1006,15 +1006,11 @@ export class VSCodeMenu { ...@@ -1006,15 +1006,11 @@ export class VSCodeMenu {
// the keybinding is not native so we cannot show it as part of the accelerator of // the keybinding is not native so we cannot show it as part of the accelerator of
// the menu item. we fallback to a different strategy so that we always display it // the menu item. we fallback to a different strategy so that we always display it
else { else {
if (isWindows) { const bindingIndex = options.label.indexOf('');
options.sublabel = binding.label; // leverage sublabel support on Windows (only) if (bindingIndex >= 0) {
options.label = `${options.label.substr(0, bindingIndex)}${binding.label}〕`;
} else { } else {
const bindingIndex = options.label.indexOf(''); options.label = `${options.label}${binding.label}〕`;
if (bindingIndex >= 0) {
options.label = `${options.label.substr(0, bindingIndex)}${binding.label}〕`;
} else {
options.label = `${options.label}${binding.label}〕`;
}
} }
} }
} }
...@@ -1022,9 +1018,6 @@ export class VSCodeMenu { ...@@ -1022,9 +1018,6 @@ export class VSCodeMenu {
// Unset bindings if there is none // Unset bindings if there is none
else { else {
options.accelerator = void 0; options.accelerator = void 0;
if (isWindows) {
options.sublabel = void 0;
}
} }
return options; return options;
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import severity from 'vs/base/common/severity'; import severity from 'vs/base/common/severity';
import { isWindows } from 'vs/base/common/platform';
import { IAction } from 'vs/base/common/actions'; import { IAction } from 'vs/base/common/actions';
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import dom = require('vs/base/browser/dom'); import dom = require('vs/base/browser/dom');
...@@ -95,11 +94,7 @@ export class ContextMenuService implements IContextMenuService { ...@@ -95,11 +94,7 @@ export class ContextMenuService implements IContextMenuService {
} else { } else {
const label = this.keybindingService.getLabelFor(keybinding); const label = this.keybindingService.getLabelFor(keybinding);
if (label) { if (label) {
if (isWindows) { options.label = `${options.label}${label}〕`;
options.sublabel = label; // leverage sublabel support on Windows (only)
} else {
options.label = `${options.label}${label}〕`;
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册