[TxMt] Override Menu Action

Mike McQuaid mike at mikemcquaid.com
Fri Jan 8 08:41:16 UTC 2016


Another possible injection selection weirdness:

I’m injecting my text.html.markdown.github grammar into text.html.markdown using the (text.html.markdown) injection selector (was (L:text.html.markdown) until the fix in the last thread) and hidden from the user with hideFromUser in the tmLanguage file. I’m wanting to override the “Preview” menu action so that my GitHub Markdown bundle’s “Preview” menu action can take priority using the same shortcut. I’ve found a few possible options that I expected to work but don’t:

- setting the scope to text.html.markdown.github doesn’t seem to match the document scope so never actually matches and the Preview runs the old Markdown one
- setting the scope to text.html.markdown pops up a little menu to let me choose between the two

This may well not be possible in TextMate 2 as-is. Any thoughts on how to do this (beyond just using another shortcut, my current solution)?

Thanks!

Mike McQuaid
http://mikemcquaid.com



More information about the textmate mailing list