Commit 0307978
committed
add modification to multi search to run one at a time
The key improvement is that we now apply each search/replace block sequentially, updating the content after each application. This ensures that each subsequent block operates on the most up-to-date content, which preserves indentation and prevents the issues that were occurring when all blocks were applied to the original content in a batch.
The implementation:
Parses all search/replace blocks from the diff content
Sorts them by start line to apply them in order
Applies each block sequentially using the applySingleDiffBlock method
Updates the content and line number delta after each block is applied
Returns the final content with all blocks applied1 parent ce4ce17 commit 0307978
File tree
2 files changed
+300
-198
lines changed- src/core/diff/strategies
- __tests__
2 files changed
+300
-198
lines changedLines changed: 60 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
424 | 480 | | |
425 | 481 | | |
426 | 482 | | |
| |||
553 | 609 | | |
554 | 610 | | |
555 | 611 | | |
556 | | - | |
| 612 | + | |
557 | 613 | | |
558 | 614 | | |
559 | 615 | | |
560 | 616 | | |
561 | 617 | | |
562 | 618 | | |
563 | 619 | | |
564 | | - | |
| 620 | + | |
565 | 621 | | |
566 | 622 | | |
567 | 623 | | |
568 | | - | |
| 624 | + | |
569 | 625 | | |
570 | 626 | | |
571 | 627 | | |
| |||
575 | 631 | | |
576 | 632 | | |
577 | 633 | | |
578 | | - | |
| 634 | + | |
579 | 635 | | |
580 | 636 | | |
581 | 637 | | |
| |||
0 commit comments