Skip to content

Commit e75fd92

Browse files
author
Bertan Ari
committed
style(apply_diff): split marker-hint guard to satisfy prettier
1 parent 4da8b64 commit e75fd92

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,10 @@ export class MultiSearchReplaceDiffStrategy implements DiffStrategy {
554554
const firstSearchLine = hintLines[0]?.trim() ?? ""
555555
const separatorSwallowed = hintLines[1]?.trim() === "-------"
556556
// Length guard: adjacent `\s*` groups backtrack quadratically on long whitespace runs.
557-
const malformedMarkerHint =
557+
const looksLikeMalformedMarker =
558558
firstSearchLine.length <= MAX_MARKER_HINT_LINE_LENGTH &&
559559
/^(?::\s*\d{1,9}:?|:?\s*start[_-]?line\s*:?\s*\d{1,9}:?)$/i.test(firstSearchLine)
560+
const malformedMarkerHint = looksLikeMalformedMarker
560561
? `\n- LIKELY CAUSE: the first line of your search content looks like a malformed start-line marker and was therefore searched for as literal file text${separatorSwallowed ? ', together with the "-------" line after it' : ""}. The only recognized form is ":start_line:<number>" on the line immediately after "<<<<<<< SEARCH", optionally followed by a "-------" line. Remove or correct that line and retry.`
561562
: ""
562563

0 commit comments

Comments
 (0)