vscode-partial-diff icon indicating copy to clipboard operation
vscode-partial-diff copied to clipboard

Compare two open tabs with single command

Open lamyergeier opened this issue 5 years ago • 7 comments

I want to reopen Feature Request: Compare two open tabs with single command #11 as the I think that it would be beneficial to have diff when two tabs are open rather than when 2 editors are visible as, in laptops the screen space tends to be small, and I usually don't prefer to open 2 visible editors.#

So, requesting you for the consideration for the originally requested feature, rather than for two visible editors.

lamyergeier avatar Dec 29 '18 10:12 lamyergeier

Hi @anishmittal2020 , thanks for your suggestion.

What about introducing a command that let you pick a tab you want to compare against. Would that work?

https://github.com/ryu1kn/vscode-partial-diff/issues/11

ryu1kn avatar Dec 29 '18 23:12 ryu1kn

Actually I think that if the extension could do diff without asking the user if only two tabs are open. Otherwise it could ask the user if total number of open tabs are not equal to 2. I am proposing this because it will be super quick for those who would open 2 tabs just to compare.

lamyergeier avatar Dec 30 '18 18:12 lamyergeier

Makes sense. Thanks for the input 👍

ryu1kn avatar Jan 01 '19 09:01 ryu1kn

I've just got to know that currently there is no API to get the list of "Open Editors"...

https://github.com/Microsoft/vscode/issues/15178

ryu1kn avatar Jan 28 '19 10:01 ryu1kn

What about vsc.window.visibleTextEditors? Maybe that helps.

I was thinking about opening a PR with that feature as I miss that as well. I also do see other ways of doing that. So far I've been using Notepad++ for that and there's a compare plugin which has pretty good UX. Either you use context menu of file tabs to select files to compare (also possible in VS Code) or you use toolbar icons to select first file to compare and then when the other is active you just click compare (toolbar or command). Both options would be good in your extension - whatever the user prefers. What do you think?

ipatalas avatar Jun 01 '19 19:06 ipatalas

I think this pretty much exists. I used File: Compare Active File With... from Ctrl+Shift+P image And then select the recently opened file which coincides with files opened on other tabs. image

This way it is possible to compare files even between WSL and Windows after first drag&dropping file from Windows.

dzid26 avatar Nov 06 '21 21:11 dzid26

Did this ever get resolved? With two tabs opened side-by-side (which I think means "two editors"), I still get "Please first open 2 documents to compare".

cwgonzalez1192 avatar Jan 04 '23 23:01 cwgonzalez1192