sajalverma17 / GitBranchDiffer

A Visual Studio Extension that displays source files Added/Modified/Renamed between a base branch you choose to diff against, and the current working branch in your Git repo. The diffed files are shown in the Solution Explorer using a Solution Explorer Filter
MIT License
6 stars 1 forks source link

Opening diff windows after filter is applied does not work if VS2019's Git compare window is already open #3

Closed sajalverma17 closed 1 year ago

sajalverma17 commented 3 years ago

Version Information :

Describe the bug Bug is in opening a file from Solution Explorer after the "Show diff in solution" filter was successfully applied on. If user has already opened a Git Diff window (comparison functionality in Visual Studio for pending changes), GitBranchDiffer brings that window into focus instead of opening a new Branch Diff comparison

To Reproduce Steps to reproduce the behavior:

  1. Apply Git branch differ filter
  2. Modify a file but do not commit it. VS will mark it with a Red Tick, meaning it is a pending change
  3. Right click on the file. Git -> Compare with Unmodified
  4. A Diff window opened by Visual Studio
  5. Now do "Open Diff With Base" on the same file, VS will just focus on the comparison with Unmodified file, since the plugin finds any open "comparison" window of the same file and brings that into focus.

Expected behavior Git branch differ should have opened a Branch Diff, but it actually found already existing diff window, and assumed it to be the diff window that should be focused on.

Additional context We have code that identifies if an already existing diff window is present. We should probably find a way to differentiate between our plugin's diff window by being able to uniquely identify them. Only bring that window in focus, or create a new if not found.