Skip to content

Commit 66334da

Browse files
committed
fix: various issues with diffing algorithm
This commit reimplements the way we track changes across two documents. Previously cursors in a document during a diff solely consisted of parent node, depth in the tree, and child index under the parent. While this was sufficient for some trivial cases, a number of real world scenarios fall apart with this due to a lack of information needed to correctly identify where in the tree a change occurred. The new cursors track the full path from the root of the document to the current cursor position, which allows us to correctly determine where in the tree a change occurs in some of the cases where previously we could not. It remains to be seen if there are more holes in our implementation, but for now our current set of test cases are correctly diffed/merged with the new algorithm. Closes #3
1 parent 07a005b commit 66334da

File tree

3 files changed

+359
-211
lines changed

3 files changed

+359
-211
lines changed

0 commit comments

Comments
 (0)