Skip to content

Commit 4619a26

Browse files
author
Eric Wheeler
committed
hack: turn off diff line number validation in apply_diff
1 parent e924271 commit 4619a26

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/diff/strategies/multi-search-replace.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,10 @@ Only use a single line of '=======' between search and replacement content, beca
423423
let searchStartIndex = 0
424424
let searchEndIndex = resultLines.length
425425

426+
startLine = endLine = 0
427+
426428
// Validate and handle line range if provided
427-
if (startLine) {
429+
if (startLine && endLine) {
428430
// Convert to 0-based index
429431
const exactStartIndex = startLine - 1
430432
const searchLen = searchLines.length
@@ -483,7 +485,7 @@ Only use a single line of '=======' between search and replacement content, beca
483485
} else {
484486
// No match found with either method
485487
const originalContentSection =
486-
startLine !== undefined && endLine !== undefined
488+
startLine && endLine
487489
? `\n\nOriginal Content:\n${addLineNumbers(
488490
resultLines
489491
.slice(

0 commit comments

Comments
 (0)