-
Notifications
You must be signed in to change notification settings - Fork 527
Closed
Description
@kpdecker your library is great so far. I think I might have found an edge case unless i'm missing something?
oldString = 'test\ntest2\n \ntest3\n';
"test
test2
test3
"
newString = 'test\ntest2\ntest3\n';
"test
test2
test3
"
Now I create a patch
d = JsDiff.createPatch('file/path.js', oldString, newString, '', '', { context: 0 });This patch/diff looks correct
"Index: file/path.js
===================================================================
--- file/path.js
+++ file/path.js
@@ -3,1 +3,0 @@
- However when I apply the patch....
result = JsDiff.applyPatch(oldString, d);
"test
test2
"
We can see it seems to be affecting the wrong line number. Is it trimming somewhere on the oldString where it shouldn't be?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels