304
305
if (isEndIndexBiggerThanStartIndex || isEndIndexEqualToStartIndexAndCoversCustomLine) {
307
>
for (let i = startIndexOfDeletion; i <= endIndexOfDeletion; i++) {
308
>
maximumSpecialHeightOnDeletedInterval = Math.max(maximumSpecialHeightOnDeletedInterval, this._orderedCustomLines[i].maximumSpecialHeight);
309
>
}
310
>
let prefixSumOnDeletedInterval = 0;
311
>
if (startIndexOfDeletion > 0) {
312
const previousSpecialLine = this._orderedCustomLines[startIndexOfDeletion - 1];
313
prefixSumOnDeletedInterval = previousSpecialLine.prefixSum + previousSpecialLine.maximumSpecialHeight + this._defaultLineHeight * (fromLineNumber - previousSpecialLine.lineNumber - 1);
315
prefixSumOnDeletedInterval = fromLineNumber > 0 ? (fromLineNumber - 1) * this._defaultLineHeight : 0;
316
}
317
>
const firstSpecialLineDeleted = this._orderedCustomLines[startIndexOfDeletion];
lineHeights.ts
318
>
const lastSpecialLineDeleted = this._orderedCustomLines[endIndexOfDeletion];
319
>
const firstSpecialLineAfterDeletion = this._orderedCustomLines[endIndexOfDeletion + 1];
320
>
const heightOfFirstLineAfterDeletion = firstSpecialLineAfterDeletion && firstSpecialLineAfterDeletion.lineNumber === toLineNumber + 1 ? firstSpecialLineAfterDeletion.maximumSpecialHeight : this._defaultLineHeight;
321
>
const totalHeightDeleted = lastSpecialLineDeleted.prefixSum
322
>
+ lastSpecialLineDeleted.maximumSpecialHeight
323
>
- firstSpecialLineDeleted.prefixSum
324
>
+ this._defaultLineHeight * (toLineNumber - lastSpecialLineDeleted.lineNumber)
325
>
+ this._defaultLineHeight * (firstSpecialLineDeleted.lineNumber - fromLineNumber)
326
>
+ heightOfFirstLineAfterDeletion - maximumSpecialHeightOnDeletedInterval;
327
>
328
>
const decorationIdsSeen = new Set<string>();
329
>
const newOrderedCustomLines: CustomLine[] = [];
330
>
const newDecorationIDToSpecialLine = new ArrayMap<string, CustomLine>();
331
>
let numberOfDeletions = 0;
332
>
for (let i = 0; i < this._orderedCustomLines.length; i++) {
333
>
const customLine = this._orderedCustomLines[i];
334
>
if (i < startIndexOfDeletion) {
335
newOrderedCustomLines.push(customLine);
336
newDecorationIDToSpecialLine.add(customLine.decorationId, customLine);
337
>
} else if (i >= startIndexOfDeletion && i <= endIndexOfDeletion) {
lineHeights.ts
338
>
const decorationId = customLine.decorationId;
339
>
if (!decorationIdsSeen.has(decorationId)) {
340
customLine.index -= numberOfDeletions;
341
customLine.lineNumber = fromLineNumber;