Commit f56b0d2
[merge addon] Fix edge case arising when diff'ing empty strings
The merge view will incorrectly show a "Revert chunk" arrow when
the text on both sides of the view are the empty string.
The getChunks() helper is not prepared to deal with an empty diff
array.
The getDiff() helper returns an empty diff array when both strings
to compare are empty, as the only diff item returned by
diff_match_patch, `[0, ""]`, is removed as a result of the diff
entry containing an empty string.
The chosen (trivial) fix is to simply check for the empty diff
array case at the top of getChunks().1 parent 6fca1c7 commit f56b0d2
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
667 | 668 | | |
668 | 669 | | |
669 | 670 | | |
| |||
0 commit comments