Sort block decorations to render by order, then id

This commit is contained in:
Ash Wilson
2019-02-01 13:14:39 -05:00
parent 3345000273
commit e8d304b8c7

View File

@@ -1191,6 +1191,10 @@ class TextEditorComponent {
decorationsByScreenLine.set(screenLine.id, decorations)
}
decorations.push(decoration)
// Order block decorations by increasing values of their "order" property. Break ties with "id", which mirrors
// their creation sequence.
decorations.sort((a, b) => a.order !== b.order ? a.order - b.order : a.id - b.id)
}
addTextDecorationToRender (decoration, screenRange, marker) {