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

jumpy swallows type events when disabled #28

Open
michaelgriscom opened this issue Jul 16, 2018 · 1 comment · May be fixed by #31
Open

jumpy swallows type events when disabled #28

michaelgriscom opened this issue Jul 16, 2018 · 1 comment · May be fixed by #31

Comments

@michaelgriscom
Copy link

michaelgriscom commented Jul 16, 2018

I'm maintaining an extension (https://github.com/michaelgriscom/LeaderMode) which leverages VSCode's type command to expand shortcut keys that jumpy clashes with. Upon being enabled, jumpy registers a custom type command, bubbling the type event to the default command if jumpy is disabled

const jumpyTypeDisposable = vscode.commands.registerCommand('type', args => {
if (!isJumpyMode) {
vscode.commands.executeCommand('default:type', args);
return;
}

The issue is that when the jumpy extension registers its type command other non-default listeners don't see the event, breaking other extensions (this is essentially the reverse of issue #1). I believe that a better approach would be to dispose of the command whenever jumpy is disabled, then re-register the command when it is enabled; that way the jumpy command only exists when the mode is active. I've taken that approach with LeaderMode and haven't noticed any perf impact

@michaelgriscom
Copy link
Author

Created a PR as a starting point for a fix

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

Successfully merging a pull request may close this issue.

1 participant