mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Use @command in Snippets extension
This commit is contained in:
@@ -24,7 +24,7 @@ module.exports =
|
||||
@snippetsByExtension[extension] = @snippetsParser.parse(text)
|
||||
|
||||
enableSnippetsInEditor: (editor) ->
|
||||
editor.on 'snippets:expand', (e) =>
|
||||
editor.command 'snippets:expand', (e) =>
|
||||
editSession = editor.activeEditSession
|
||||
prefix = editSession.getLastCursor().getCurrentWordPrefix()
|
||||
if snippet = @snippetsByExtension[editSession.getFileExtension()]?[prefix]
|
||||
@@ -37,10 +37,10 @@ module.exports =
|
||||
else
|
||||
e.abortKeyBinding()
|
||||
|
||||
editor.on 'snippets:next-tab-stop', (e) ->
|
||||
editor.command 'snippets:next-tab-stop', (e) ->
|
||||
unless editor.activeEditSession.snippetExpansion?.goToNextTabStop()
|
||||
e.abortKeyBinding()
|
||||
|
||||
editor.on 'snippets:previous-tab-stop', (e) ->
|
||||
editor.command 'snippets:previous-tab-stop', (e) ->
|
||||
unless editor.activeEditSession.snippetExpansion?.goToPreviousTabStop()
|
||||
e.abortKeyBinding()
|
||||
|
||||
Reference in New Issue
Block a user