fix(hashline-edit): do not restore indentation for replace_lines

- applyReplaceLines: use stripped array directly instead of restoreLeadingIndent
- applySetLine: keep restoreLeadingIndent (1:1 replacement needs indent preservation)
- Added test case for replace_lines preserving new line indentation
- All 3025 tests pass

🤖 Generated with OhMyOpenCode assistance
This commit is contained in:
YeonGyu-Kim
2026-02-20 17:47:37 +09:00
parent ce7a5427c0
commit 258e9d473c
2 changed files with 12 additions and 6 deletions
+1 -6
View File
@@ -124,12 +124,7 @@ export function applyReplaceLines(
const result = [...lines]
const stripped = stripRangeBoundaryEcho(lines, startLine, endLine, toNewLines(newText))
const newLines = stripped.map((entry, idx) => {
const oldLine = lines[startLine - 1 + idx]
if (!oldLine) return entry
return restoreLeadingIndent(oldLine, entry)
})
result.splice(startLine - 1, endLine - startLine + 1, ...newLines)
result.splice(startLine - 1, endLine - startLine + 1, ...stripped)
return result
}