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
184 stars 15 forks source link

allow diff'ing Multi-cursor selections #16

Closed myrdd closed 6 years ago

myrdd commented 6 years ago

Steps:

1. first selection:

first selection

2. Copy the selection (Ctrl+C)

3. second selection:

second selection

4. compare text with clipboard:

compare text with clipboard

Current result:

current diff result

Expected result:

expected diff result


[BTW] scenario 2

When instead using "select text for compare" (step 2) and "compare text with previous selection" (step 4), the outcome is like this:

diff result of scenario 2


[My system]

PS: Thank you for this great extension!

ryu1kn commented 6 years ago

Hi @myrdd, thanks for your suggestion with the clear description, specific environment info and very helpful screen images!! 😭

And yes, at the moment, it doesn't support the multi-cursor selection. Time to support it!

ryu1kn commented 6 years ago

Released as v0.4.0! 😃

myrdd commented 6 years ago

Wow, great, it works very well! :)

Still, I found a tiny bug: It make a difference if you select the text top-to-bottom or bottom-to-top. I guess you need to consider Selection.isReversed.

ryu1kn commented 6 years ago

Still, I found a tiny bug: It make a difference if you select the text top-to-bottom or bottom-to-top.

Oh wow, thank you for finding the bug. You're right. Copying & pasting the texts to other place retains the positional order even when I select them from bottom-to-top; so Partial-diff should follow that behaviour.

ryu1kn commented 6 years ago

Released as v0.4.1! 😃

myrdd commented 6 years ago

Great support! Many thanks!! 👍 🎆 😄

ryu1kn commented 6 years ago

You're welcome, thanks for the great suggestion! 😉