Vscode: New explorer: switching editors should clear focus

Created on 6 Feb 2019  路  8Comments  路  Source: microsoft/vscode

I find myself way more often in a situation where the explorer is not indicating to me what the currently active file is or it indicates 2 things as being selected and focused. Now that I think about it I think this is what happens:

  • I click on a file to open it
  • I click on a folder to expand it
  • I jump to another editor

Now I can be in two states:

  • either I get the currently active file not as selected
  • or I see the folder and the file as being selected which imho is not very useful

I think in the old explorer we always cleared focus when we revealed the active file to ensure that only the file that is active shows selected/focused in the explorer and I very much liked that behavior.

Proof:
peek 2019-02-06 12-13

file-explorer regression

Most helpful comment

I have decided to go back to the old bheavior: that the selection and focus are more aligned.
Please try it out in wednesday's vscode insiders and let me know what you think of the behavior.
Fixed via 9ef682db65

All 8 comments

@isidorn This is about having switched from using selection to focus when revealing the explorer files. Please re-evaluate whether you still want to keep pushing this.

I have also noticed this problem. Also, I notice that when I use cmd+p to navigate to a file, the file chosen is not made active in the explorer. (e.x. all folders are collapsed, I choose a file using cmd+p, and the folders in the explorer remain collapsed and the open file is not given focus).

Also, when changing files using the active tabs, the old file remains highlighted along with the new one.

Also: the command Cmd+P > File: Reveal Active File in Side Bar focuses the previous explorer selection instead of the active tab.

I agree that this should be improved. If you select a file from the explorer, it should be highlighted until you stop using that file. If you select an open tab for another file, why is the original file highlighted in the sidebar? Why not give the option. The sidebar should have one file selected. There must be a reason that some people like having two files highlighted, but I think there should only be one file highlighted at a time. Whatever tab is open is the file that should be highlighted. If someone wants historical highlighting in the sidebar, please make that configurable. The default behavior should be one file highlighted based on what tab is open. Thank you!

The current behavior really makes no sense and I really hope it is a bug and not intended behavior.

In addition, the highlighted file MIGHT update when switching focus on a tab or navigating to a different file, but it seems inconsistent. And if it does indeed update on file change, there are usually two files highlighted.

I really cannot think of a use-case where a developer would want that, which is why I am really hoping this is a bug.

image

When this happens, using View > Show explorer (workbench.view.explorer, bound to Ctrl + shift + E) doesn't focus the current file, either:

peek 2019-02-17 21-34

I have decided to go back to the old bheavior: that the selection and focus are more aligned.
Please try it out in wednesday's vscode insiders and let me know what you think of the behavior.
Fixed via 9ef682db65

Thank you!! I look forward to checking out the revert! The new functionality really annoyed me and lowered my productivity as I had to hunt to find what file was actually focused.

Was this page helpful?
0 / 5 - 0 ratings