refactor(hashline-edit): rename legacy operation names in error messages

Update error messages to match current op schema:
- insert_after → append (anchored)
- insert_before → prepend (anchored)
This commit is contained in:
YeonGyu-Kim
2026-02-24 15:33:48 +09:00
parent 9a2e0f1add
commit 8c3a0ca2fe

View File

@@ -80,7 +80,7 @@ export function applyInsertAfter(
const result = [...lines]
const newLines = stripInsertAnchorEcho(lines[line - 1], toNewLines(text))
if (newLines.length === 0) {
throw new Error(`insert_after requires non-empty text for ${anchor}`)
throw new Error(`append (anchored) requires non-empty text for ${anchor}`)
}
result.splice(line, 0, ...newLines)
return result
@@ -97,7 +97,7 @@ export function applyInsertBefore(
const result = [...lines]
const newLines = stripInsertBeforeEcho(lines[line - 1], toNewLines(text))
if (newLines.length === 0) {
throw new Error(`insert_before requires non-empty text for ${anchor}`)
throw new Error(`prepend (anchored) requires non-empty text for ${anchor}`)
}
result.splice(line - 1, 0, ...newLines)
return result