Use an overloaded 'tab' keybinding and the new abortKeyBinding method to implement conditional snippet expansion

If the current word prefix doesn't correspond to a valid snippet, we abort the key binding and try the next one, which ends up being the standard tab binding so a typical tab gets inserted. This is a mechanism that could support overloading of arbitrary keys.
This commit is contained in:
Nathan Sobo
2012-06-20 22:47:05 -06:00
parent 68cb9992fc
commit f1678fdafe
3 changed files with 18 additions and 10 deletions

View File

@@ -0,0 +1,6 @@
window.keymap.bindKeys '.editor'
'tab': 'snippets:expand'
window.keymap.bindKeys '.editor'
'tab': 'snippets:next-tab-stop'
'shift-tab': 'snippets:previous-tab-stop'