vscode icon indicating copy to clipboard operation
vscode copied to clipboard

autoReveal, but only when a file is explicitly selected

Open jakub-homola opened this issue 11 months ago • 2 comments

I am following up on https://github.com/microsoft/vscode/issues/38899

The OP requested:

I'd like to propose a third option ... With this option, clicking on a tab in the main view (even for the currently active file) would reveal the file in the explorer.

But the given solution "explorer.autoReveal": "focusNoScroll" does not solve this request.

Please reopen the referenced issue.

@isidorn

jakub-homola avatar Jan 11 '25 13:01 jakub-homola

I'm not sure I understand what is being asked and how focusNoScroll doesn't solve it. Can you elaborate?

lramos15 avatar Jan 15 '25 14:01 lramos15

As I understand it, the requested behavior is like "explorer.autoReveal": "focusNoScroll", but with additional feature.

If I click on the header of the currently open tab, the explorer will scroll to the file.

In other words,

this one is about preserving the existing behaviour (autoReveal causes a scroll) except in the situation where a tab is activated 'implicitly' (i.e. not as a result of the user clicking on it).

So, as I understand it, with clicking the tab header or switching the tab with a key shortcut (if a tab was activated explicitly), the explorer will scroll. If a tab becomes active because another tab was closed (it becomes active implicitly), the explorer will not scroll.

I just noticed that the context menu option when right-clicking on the tab header, "Reveal in Explorer View", can partially substitute this. This is maybe enough for me (will try to use it more, thought it is still two clicks), but it is not a solution to the original request.

jakub-homola avatar Jan 15 '25 15:01 jakub-homola

The original request is 7 years old, and this is the first I've heard of it. I will close this for now as there are no plans to implement such a feature anytime soon, but you can bind keybindings to the reveal in explorer view so that it is only one keystroke away and then use focusNoScroll to accomplish what you want.

lramos15 avatar Jan 17 '25 16:01 lramos15