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

Doesn't work with auto-lose focus #10

Open
AntonPuko opened this issue Oct 26, 2017 · 4 comments
Open

Doesn't work with auto-lose focus #10

AntonPuko opened this issue Oct 26, 2017 · 4 comments

Comments

@AntonPuko
Copy link

AntonPuko commented Oct 26, 2017

Hi, thanks for the feature. But it seems the plugin works only when I manually click on editor area with my mouse. If I switch from a sidebar another way, like with ctrl+[number] or just selecting the file in a file tree with enter key, the sidebar still there.

@Venryx
Copy link
Owner

Venryx commented Oct 26, 2017

Yeah unfortunately, for now, I'm just detecting editor focus by means of the "editor selection changed" event. Which of course, doesn't trigger from just a focus change.

There might be a better way to detect editor focus, though. If you find an event in the vscode API for detecting it more universally, I'll look into adding it.

@AntonPuko
Copy link
Author

what are the reasons behind those checks:
singlePos and selection.kind != TextEditorSelectionChangeKind.Mouse ?
seems if I remove those, it works just fine with all the cases.

@Venryx
Copy link
Owner

Venryx commented Oct 26, 2017

I think those checks were mainly to fix a problem when scrolled to the right -- changing the selected text range would trigger the sidebar-open-then-close, which would shift the scroll left and then right, causing the selection and scroll position to be messed up. This way, it only triggers when you first click onto a new position, which doesn't cause the same issue. (I forget the details, but I know this was at least one of the problems solved by some added checks; another check was added to prevent auto-hide when merely selecting text in the terminal panel.)

@witek
Copy link

witek commented Feb 22, 2021

another check was added to prevent auto-hide when merely selecting text in the terminal panel

Why would you not want to auto-hide when selecting text in the terminal panel? I would expect auto-hide on all actions, which don't happen in the sidebar itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants