This should greatly improve performances as we only need to diff lines instead of individual characters. Closes #2678 Fixes #2037