Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing the last open file, then hiding and showing the explorer reopens the file #68132

Closed
JosiahWitt opened this issue Feb 7, 2019 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues verified Verification succeeded
Milestone

Comments

@JosiahWitt
Copy link

  • VSCode Version: 1.31.0
  • OS Version: Linux x86 (Solus)

Steps to Reproduce:

  1. Close all open files
  2. Open a file or two from the explorer
  3. Close the files (they remain selected in the explorer)
  4. Hide the explorer (either click on the explorer icon, CTRL+B, or switch to searching, extensions, etc.)
  5. Show the explorer
  6. The most recently closed file is now opened

This behavior has changed from the previous release. In the previous release, the file was deselected from the explorer when it was closed. In 1.31.0, the file remains selected, which gives the behavior described above.

I prefer the previous behavior, as usually, I don't want to reopen the most recently closed file. It causes extra visual noise.

Some examples of past related issues are: #998 and #6922

Does this issue occur when all extensions are disabled?: Yes

Example of behavior

@vscodebot vscodebot bot added the new release label Feb 7, 2019
@bpasero bpasero removed their assignment Feb 8, 2019
@vscodebot vscodebot bot removed the new release label Feb 10, 2019
@isidorn isidorn added the *duplicate Issue identified as a duplicate of another issue(s) label Feb 18, 2019
@vscodebot
Copy link

vscodebot bot commented Feb 18, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Feb 18, 2019
@JosiahWitt
Copy link
Author

I'm curious what Issue is tracking this? The one that references it was closed as a duplicate of this one. Thanks!

@isidorn
Copy link
Contributor

isidorn commented Feb 18, 2019

Some old issue assigned to me.
Try to find it, you would do the same as me. The point in that issue is that this is designed behavior.

@JosiahWitt
Copy link
Author

Oh, it is designed behavior? The behavior changed from version 1.30, and it has been driving me nuts! I don't mind creating a PR if you point me to relevant code. Thanks!

@isidorn
Copy link
Contributor

isidorn commented Feb 18, 2019

My mistake, I have wronlgy read your description. Reopening and assigning to this milestone to investigate.

@isidorn isidorn reopened this Feb 18, 2019
@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues and removed *duplicate Issue identified as a duplicate of another issue(s) labels Feb 18, 2019
@isidorn isidorn added this to the February 2019 milestone Feb 18, 2019
@JosiahWitt
Copy link
Author

No worries! Something else that may be related is the case that if you select a file in the explorer tree, and then click on a different tab, the active file is not highlighted in the tree. Version 1.30 would always highlight the active file in the explorer tree.

Let me know if you need any more info, or if I can help with writing the bugfix! Thanks!

Example

@isidorn
Copy link
Contributor

isidorn commented Feb 19, 2019

Fixed. You can try it out in wednesday vscode insiders

@isidorn isidorn closed this as completed Feb 19, 2019
@JosiahWitt
Copy link
Author

Great! Thank you! I'll check it out!

@JosiahWitt
Copy link
Author

@isidorn The main issue I reported seems to be fixed in the insiders build today! 🎉 The related bug I mentioned in a comment above still remains. Should I open another Issue for that bug? Thank you!

@isidorn
Copy link
Contributor

isidorn commented Feb 21, 2019

Yes, please open a new issue.

@JosiahWitt
Copy link
Author

Alright! I created #69152. Thanks again!

@jacobweber
Copy link

Tried this on the insiders build from today.

It works if explorer.autoReveal is true (the default). When you close the last file, it de-selects the file in the Explorer, so it's not opened the next time you switch to Explorer.

But if explorer.autoReveal is false, it doesn't change the Explorer selection when you close a file (by design). And switching back to Explorer re-opens the selected file. So the confusing behavior is still there.

I think there should be a preference that stops this behavior; e.g. "don't open selected file when switching to Explorer".

FYI, I also opened #52638 about this a while back.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants