ryu1kn / vscode-partial-diff

Visual Studio Code Extension. Take a diff of 2 parts of text(s)
https://marketplace.visualstudio.com/items?itemName=ryu1kn.partial-diff
MIT License
186 stars 16 forks source link

When using normalization, display the original rather than the normalized text #92

Open stanspas opened 1 year ago

stanspas commented 1 year ago

Currently, Pre-Comparison Text Normalization Rules replace text and then a normal comparison is performed on the result. When looking at the diff, the user has no easy way of knowing what the original (non-normalized) text was.

It would be useful if the normalization could be used solely for purposes of providing the inputs to a diff algorithm, generating the chunking/highlights of changes, and then - at diff display time - the text is replaced back with the original text while preserving the highlights generated based on the normalized version.

An example use case is to ignore timestamps when comparing logs for purposes of change highlighting, while still being able to see those timestamps while looking through the diff.

For reference: Meld's text filters feature achieves what I am describing.