fix(hashline-edit): detect overlapping ranges and prevent false unwrap of blank-line spans
- Add detectOverlappingRanges() to reject edits with overlapping pos..end ranges instead of crashing with undefined.match() - Add bounds guard (?? "") in edit-operation-primitives for out-of-range line access - Add null guard in leadingWhitespace() for undefined/empty input - Fix restoreOldWrappedLines false unwrap: skip candidate spans containing blank/whitespace-only lines, preventing incorrect collapse of structural blank lines and indentation (the "애국가 bug") - Improve tool description for range replace clarity - Add tests: overlapping range detection, false unwrap prevention
This commit is contained in:
@@ -34,8 +34,8 @@ FILE CREATION:
|
||||
CRITICAL: only unanchored append/prepend can create a missing file.
|
||||
|
||||
OPERATION CHOICE:
|
||||
replace with pos only -> replace one line at pos
|
||||
replace with pos+end -> replace range pos..end
|
||||
replace with pos only -> replace one line at pos (MOST COMMON for single-line edits)
|
||||
replace with pos+end -> replace ENTIRE range pos..end as a block (ranges MUST NOT overlap across edits)
|
||||
append with pos/end anchor -> insert after that anchor
|
||||
prepend with pos/end anchor -> insert before that anchor
|
||||
append/prepend without anchors -> EOF/BOF insertion
|
||||
|
||||
Reference in New Issue
Block a user