feat: strict mode + simplified hashline edit operations

- Consolidated `replace` operations and removed `insert`.
- Improved line hash collision resistance for symbol-only text.
This commit is contained in:
can1357
2026-02-22 23:45:01 +01:00
parent 768ee7a269
commit 0e1a4ef15a
50 changed files with 1980 additions and 660 deletions
+2 -2
View File
@@ -414,11 +414,11 @@ export async function computeHashlineDiff(
const normalizedContent = normalizeToLF(content);
const result = applyHashlineEdits(normalizedContent, edits);
if (normalizedContent === result.content) {
if (normalizedContent === result.text) {
return { error: `No changes would be made to ${path}. The edits produce identical content.` };
}
return generateDiffString(normalizedContent, result.content);
return generateDiffString(normalizedContent, result.text);
} catch (err) {
return { error: err instanceof Error ? err.message : String(err) };
}