Open bordaigorl opened 10 years ago
Thanks!
Hmm, this is a really interesting idea. I'll take a look at some point later. Thanks again!
I ran into the same problem with the never ending loop when invoking a TextCommand in the on_selection_modified
listener. I used a simple boolean flag to resolve the problem. Before invoking the command, you toggle the flag so that you can ignore the resulting event.
Just look for the ignoreSelectionCommand
variable here.
I could imagine, that this is easier than defining a keymap with every letter and enabling/disabling it correspondingly.
Hi, hilarious idea! I read your notes in the readme about Sublime lacking a keypress event. Here's how you could emulate that, it's a bit hackish but it should work.
You could create a
on_query_context
listener so you can add ahacker_typer_enabled
context to keymaps and then install a keymap with maps for every letter invoking a command to insert text. Instead of a context, the enable/disable command could rename the keymap of the plugin so it is no longer detected by ST (i.e. by adding a-disabled
suffix to the filename) so the defaults take over.