kdcro101 / vscode-favorites

Add files and directories to workspace favorites. You can create groups (and subgroups) of favorite items with files and folders. Time saver for complex projects.
MIT License
49 stars 13 forks source link

Switch to editor group with a favorite file if already open (when opening via palette) #47

Open certainlyakey opened 4 years ago

certainlyakey commented 4 years ago

Describe the bug Thanks for the great plugin!

I usually work with many editor groups open. Here's a small bug/inconsistency/feature request that I've discovered.

I'd love also maybe a configuration setting that allows to switch the way this works.

To Reproduce Steps to reproduce the behavior:

  1. Open a window with two groups (A and B), with two files opened in each (A1, A2 in the first, and B1, B2 in the 2nd).
  2. Favorite all the four files.
  3. Put the cursor into editor A1.
  4. Open the favorites palette.
  5. Click on a favorite in the palette that is currently opened as B2.
  6. What happens is that the favorite opens in a new editor (A3) in the group.

Expected behavior The expected result is that already opened editor (B2) gets focus, instead of the file being opened in a duplicate tab.

System info (please complete the following information):

Note that the correct behavior is observed when you open a favorite via the favorite explorer — an existing editor is reused and refocused instead of a new one getting created.

Again, this might not be considered a bug, but rather a request for a setting that switches opening already opened files anew or reusing existing editors.

Thanks!