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

Side-by-Side diff that understands comments #56

Closed HidekiAI closed 3 years ago

HidekiAI commented 4 years ago

Label: Enhancement On a top-bottom diff, we commonly see:

++// some code;
++// more code;
--some code;
--more code;

But for side-by-side, if the comments are small block of code, it's somewhat acceptable, but when the block of code is page size (i.e. one PageDn size), the side-by-side will take double the PageDn amount (not to mention that it defeats the usefulness of side-by-side comparison since you would have to PgUp/PgDown); I am aware that depending on the programming (or scripting) language, the commenting keywords/tokens differs (i.e. C# and F# can be // while BASH would be #, etc), and most diff tools will not intelligently try to do the side-by-side due to this; there are other diff tools such as WinMerge that tries to bias towards languages of choices (after all, diff tools are mostly useful for programmers) as well as sdiff --minimal which tries to do side-by-side detecting commented lines (not well, but at least it tries better than diff --side-by-side); even diffing by words (i.e. git diff --word-diff can somewhat compress the block change by indicating that only differences were the comment.

ryu1kn commented 3 years ago

Hi @HidekiAI . I'm not too sure if I got you right. Would it be possible to post a screenshot of how it looks now with Partial diff and how you want it to be (probably the screenshot of how another diff viewer presents the same diff?)

ryu1kn commented 3 years ago

Closing this for now. Reopen this once you have more details to share. Thank you!