Venryx / vscode-vtools

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

Trigger toggle asynchronously, with a slight delay #2

Closed pdf closed 7 years ago

pdf commented 7 years ago

Avoids accidental text selection when buffer position changes during mouse-click.

I often find myself accidentally selecting text when the auto-toggle kicks in because the buffer changes position while the mouse-button is still depressed. Adding a small delay mostly solves the problem, though being able to execute the toggle on the back of mouse-up instead of the focus event would solve the problem entirely, without any delay. Not sure if there's a sensible API hook to implement the latter, so this does the job in the mean time.

Venryx commented 7 years ago

Thanks for the pull-request!

I made some further improvements, and added it to the extension.

You can configure the delay-time using the vtools.autoHideDelay setting -- it defaults to 300.