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:
@@ -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) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user