-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you add the comparison of last two opened document tabs? #7
Comments
I'm not sure if it's possible to detect what tabs are last opened twos, I need investigate. If this is possible, where to display the 'Compare ...' context menu? |
This menu item can be added not to the context menu but rather to the main "File" menu. |
The code from the TidyTabs extension can help to figure out the tab opening order. |
Thanks, I will take a look. |
Hi @heku, |
This way, user always need move the tab to compare to eithor left or right of current tab firstly, I think this is not more friendly than current approcah - copy the content then 'Compare with Clipboard', let's think again to find if there's any better way. |
Let me describe the root of my problem: I have an extension - Object Dumper. It creates the dumps of debugged objects and opens them as separate documents. Those documents are not part of the solution. But I would like to have the ability to compare two of the generated documents. The 'Compare with Clipboard' approach won't work in this case. |
I see the file name issue, I think I need to look up some vsix docs to fix it. |
Yup and not file name issue only - it takes the document's text for an active item from the document, but for the second tries to get it from the file, but the file is empty. That's why I'm asking about the comparison of the two tabs. |
Hi @ycherkes , after a little research, I think we need update our code together to resolve this problem. Currently this extension supports both VS's builtin file compare service and external tools, these are all based on physical files, i.e. the core API is something like So, if the physical file contains nothing but VS hold its unsaved changes, then it won't work as your expect, but it looks reasonable to me, for external tools, it's reasonable that they don't know these unsaved content. And from my test, although VS's builtin diff service take two files path as parameters, seems VS treats them differently, VS loads left file content from physical file, but loads right file with cache (VS unsaved content), that's why left side is empty in your last screenshot. I also checked your extension's code, looks like you can change this line newDocument.Save(); Then VS will save the content to pyhsical temp file too, this should fix the issue you have. Regarding the file name issue, I'll enhance the code, pass the display name to diff tool. |
Hey @heku, |
@ycherkes np, thx for the feedback too. |
Hi @ycherkes, the file name issue fixed, could you please test the latest dev branch build https://dev.azure.com/heku/d55bc262-1377-4ae3-9410-4c98cfa53de8/_apis/build/builds/149/artifacts?artifactName=drop&api-version=7.0&%24format=zip |
Hi @heku, I've tested a VsDiff.2022.vsix, all works fine! |
@ycherkes Thanks. |
I think it will be very useful to have an option to compare two last opened document tabs like it's done in a Compare plugin of notepad++.
Because it's not necessary that the opened file is a part of the solution. It can be externally opened in Visual Studio.
Is that possible?
The text was updated successfully, but these errors were encountered: