Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds options to Diff and DiffChunks. The only option I've implemented is Transform, which is a function to modify lines before diffing.
I find myself often having to modify files before diffing so that I can ignore differences I don't care about and concentrate on those I do. One example might be diffing the log output of a program running at different times, where you want to ignore the timestamp. There are many others. However, the problem with modifying the lines before diffing is that I'd like the output and context lines to refer to the original lines before they were modified. That is what the Transform option does.
Note that if a transform is not provided then no copying is done, and there is no change to the calling convention for existing callers. If there are additional options in the future, they can be added to the options structure.