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

same solution on all OS (for #14622)

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