Venryx / vscode-vtools

A collection of small tools for Visual Studio Code.
MIT License
21 stars 10 forks source link

[bug] Remember last open file window #7

Open scottwarren opened 7 years ago

scottwarren commented 7 years ago

Regardless of the last open sidebar menu (eg file explorer) the opened window when the sidebar is re-opened (I use the shortcut cmd+\), it re-opens the search sidebar menu instead.

I suspect the issue is related to these lines:

https://github.com/Venryx/vscode-vtools/blob/32250322b5021f5a61508556bbf1fc0ecbf2a318/src/extension.ts#L22-L27

I theorise that the executing these commands means that VS Code thinks that was the last open sidebar menu is the search.

GIF because one picture is worth a thousand words 🙌 :

kapture 2017-09-13 at 11 50 22

Assuming my theory is correct, the solution that I'm thinking (without any VS Code extension development experience) is that we need to save the current open sidebar menu, and execute that command last (so that it hides that sidebar menu last)

Happy to open a PR if you'd like 👍

Venryx commented 7 years ago

Yeah, it would be ideal if it remembered the side-panel open. For me, it's not a big deal, since I always just use the panel-specific shortcuts (eg. ctrl-shift-f), but best to have it preserved as well when using the generic ctrl-b shortcut.

A pull-request sounds good. However, I don't know a way atm to see what side-panel is open. If you see a means in the API, then feel free to add.