microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.9k stars 29.52k forks source link

Do not expand explorer tree when closing a tab without focus. #231981

Open tjsr opened 1 month ago

tjsr commented 1 month ago

A small quality of life improvement I'd like to see is that when you close an editor tab by middle-clicking it, the explorer.autoReveal functionality kicks in and expands the file explorer tree to the location of that file you just closed the tab for, including when you have your explorer tree collapsed.

I would like an option to prevent this behaviour - so that if you close a tab for a file in a collapsed tree, the tree does not expand or get focused.

This would prevent my explorer tree - particularly when I close a file in a workspace project not related to my current task - from becoming distracting.

I've had a bit of a look to see if another feature request exists for this, but couldn't find one.

To replicate this behaviour:

  1. Open a workspace that has multiple projects or folders.
  2. Open one file in each of the two projects from that tree.
  3. Collapse/minimize the file tree in the explorer view.
  4. Middle-click the tab of a file not currently focused in the editor view.

Current behaviour: The explorer view navigates to the file you just closed, and expands the tree. Desired behaviour: Explorer view does not navigate to the closed file, and keeps the tree unaltered and collapsed.

vs-code-engineering[bot] commented 1 month ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!