918
* Special care must be taken when multiple inline decorations are at play and they overlap.
919
*/
920
>
function _applyInlineDecorations(lineContent: string, len: number, tokens: LinePart[], _lineDecorations: LineDecoration[]): LinePart[] {
viewLineRenderer.ts
921
>
_lineDecorations.sort(LineDecoration.compare);
922
>
const lineDecorations = LineDecorationsNormalizer.normalize(lineContent, _lineDecorations);
923
>
const lineDecorationsLen = lineDecorations.length;
924
>
925
>
let lineDecorationIndex = 0;
926
>
const result: LinePart[] = [];
927
>
let resultLen = 0;
928
>
let lastResultEndIndex = 0;
929
>
for (let tokenIndex = 0, len = tokens.length; tokenIndex < len; tokenIndex++) {
930
>
const token = tokens[tokenIndex];
931
>
const tokenEndIndex = token.endIndex;
932
>
const tokenType = token.type;
933
>
const tokenMetadata = token.metadata;
934
>
const tokenContainsRTL = token.containsRTL;
935
>
936
>
while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset < tokenEndIndex) {
937
const lineDecoration = lineDecorations[lineDecorationIndex];
938