voideditor / void

https://voideditor.com
MIT License
8.01k stars 396 forks source link

Fix newline bug in `getDiffedLines` #8

Closed andrewpareles closed 1 month ago

andrewpareles commented 1 month ago

We define a "diff" as a single green/red pair that denotes a change.

We create diffs by using the function getDiffedLines, which takes in an old string and the new string and outputs the information of each diff (the range of the diff, the original text of the diff, etc). Right now, getDiffedLines occasionally outputs the wrong number of newlines. We think this caused by inconsistencies in diffLines:

image

Here is an example of the bug: image

andrewpareles commented 1 month ago

This is really part of #7.