Forcing higher precedence for your package's keybindings


#1

I’m building a plugin to run bundle install on your current project. Everything’s working great, after the bundle happens it gives you the results in a little panel, that says “Success! [see output]”. That panel stays there until you either click the close button or you hit escape. My problem is that vim-mode has it’s own keybinding for escape (.vim-mode.command-mode:not(.mini)) which is a higher specificity than mine (.workspace.ruby-bundler-active).

So hitting escape never does a thing.

My awful hack around this has been to add three classes to .workspace. instead of one. So my selector now looks like .workspace.ruby.bundler.active. This makes my keybinding work because it has a higher specificity.

So… is there a cleaner way to do this? I was trying to look through the command-palette keymaps to see if I could shed some light, as it has my desired behavior of hitting escape to exit out of it’s dialogue.

Any ideas?