提交 0c2dffdd 编写于 作者: B Benjamin Pasero

status - fix right entries sorting

上级 7af87abd
......@@ -487,17 +487,18 @@ export class StatusbarPart extends Part implements IStatusbarService {
private appendOneStatusbarEntry(itemContainer: HTMLElement, alignment: StatusbarAlignment, priority: number): void {
const entries = this.viewModel.getEntries(alignment);
// Some massaging due to display: float is needed
if (alignment === StatusbarAlignment.RIGHT) {
entries.reverse();
priority *= -1;
entries.reverse(); // reversing due to display: float
}
// find an entry that has lower priority than the new one
// and then insert the item before that one
let appended = false;
for (const entry of entries) {
if (entry.priority < priority) {
if (
alignment === StatusbarAlignment.LEFT && entry.priority < priority ||
alignment === StatusbarAlignment.RIGHT && entry.priority > priority
) {
this.element.insertBefore(itemContainer, entry.container);
appended = true;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册