mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
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:
6
src/app/keymaps/snippets.coffee
Normal file
6
src/app/keymaps/snippets.coffee
Normal 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'
|
||||
Reference in New Issue
Block a user