Open vsquared56 opened 1 year ago
Hi, thanks for this project! I noticed the following issue which may come up when, for example, entire code blocks are inserted.
Consider these two simple .js files:
File1:
function foo() { console.log("foo"); }
File2:
function foo() { console.log("foo"); } function bar() { console.log("bar"); }
Here, the line-level diff is expected, it's clear that all of bar() was inserted, along with its end brace:
bar()
Now, consider a similar addition, but with a simple change inside foo():
foo()
File3:
function foo() { bar(); console.log("foo"); } function bar() { console.log("bar"); }
Comparing File1 with File3 shows the change begins at the end brace of foo(), and it's not immediately clear that a complete function was added.
File1
File3
Worth noting that this matches the behavior of GNU diff:
But tools like DiffChecker.com give output that is potentially more useful:
Hi, thanks for this project! I noticed the following issue which may come up when, for example, entire code blocks are inserted.
Consider these two simple .js files:
File1:
File2:
Here, the line-level diff is expected, it's clear that all of![image](https://github.com/mmanela/diffplex/assets/6411694/ce48233f-e80f-4bab-a398-403b48905f53)
bar()
was inserted, along with its end brace:Now, consider a similar addition, but with a simple change inside
foo()
:File3:
Comparing
File1
withFile3
shows the change begins at the end brace offoo()
, and it's not immediately clear that a complete function was added.Worth noting that this matches the behavior of GNU diff:![image](https://github.com/mmanela/diffplex/assets/6411694/c18ab662-bf67-428d-8b74-e61cbe2304b0)
But tools like DiffChecker.com give output that is potentially more useful:![image](https://github.com/mmanela/diffplex/assets/6411694/38b00656-d270-4457-a4bc-ec11a7e8d85a)