提交 9f5a8182 编写于 作者: J Johannes Rieken

proper compare function, fixes #8756

上级 68c32f78
......@@ -181,14 +181,15 @@ class Menu implements IMenu {
}
private static _compareMenuItems(a: IMenuItem, b: IMenuItem): number {
let ret: number;
if (a.group && b.group) {
ret = Menu._compareGroupId(a.group, b.group);
}
if (!ret) {
ret = a.command.title.localeCompare(b.command.title);
if (a.group === b.group) {
return a.command.title.localeCompare(b.command.title);
} else if (!a.group) {
return 1;
} else if (!b.group) {
return -1;
} else {
return Menu._compareGroupId(a.group, b.group);
}
return ret;
}
private static _compareGroupId(a: string, b: string): number {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册