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

Diff the two most recent items in the clipboard #50

Open redoak opened 4 years ago

redoak commented 4 years ago

I would like to diff two texts copied from outside of vscode. Currently my process is to copy the first text, switch to vscode, open a new file/tab, paste text, switch back to the other program, copy second text, switch back to vscode and run Compare text with Clipboard.

If possible the process would be simplified if I could copy text twice, switch to vscode and run Compare texts from Clipboard.

Ideally I would like to be able to open an empty diff view and edit both sides, pasting new text when I want to diff against it without first having to select the other text and run the diff command, and not ending up with temporary unsaved file when I'm done. I imagine making it possible to edit the diff view could be a lot of work, so that's why I suggest the feature above.

ryu1kn commented 4 years ago

Hi @redoak thanks for the suggestion with the detailed your current workflow, that helps a lot.

I vaguely remember that now vscode diff view has an option to make the view editable; so opening an empty diff view and populate contents later may actually be possible. Though you still need to copy 2 texts one-by-one.

On the other hand, I wonder if your first suggestion may not be possible. Clipboard keeps only the last contents; so i don't think copying twice first then switching to vscode, and pasting them twice would work. Happy to be corrected though.

redoak commented 4 years ago

After looking around I wasn't able to find any way to retrieve the clipboard history. I suppose the history accessible through WindowsKey+V is managed by a Windows service and not available through API. Manually pasting from the WindowsKey+V history into vscode can make some workflows less cumbersome though.