* Process a changed area with flexible sizing.
( diffLines: DiffLine[], start: number, end: number, offset: number, )
| 419 | * Process a changed area with flexible sizing. |
| 420 | */ |
| 421 | function processFlexibleSizeGroup( |
| 422 | diffLines: DiffLine[], |
| 423 | start: number, |
| 424 | end: number, |
| 425 | offset: number, |
| 426 | ): DiffGroup { |
| 427 | // Calculate the starting line in old content. |
| 428 | let oldContentLineStart = countOldContentLines(diffLines, 0, start - 1); |
| 429 | |
| 430 | // Calculate the end line in old content. |
| 431 | let oldContentLineEnd = |
| 432 | oldContentLineStart + countOldContentLines(diffLines, start, end) - 1; |
| 433 | |
| 434 | return { |
| 435 | startLine: oldContentLineStart + offset, |
| 436 | endLine: oldContentLineEnd + offset, |
| 437 | lines: diffLines.slice(start, end + 1), |
| 438 | }; |
| 439 | } |
no test coverage detected