by
0 7
0
3
1,319
1
Top 1% !
Famous
Specified
Popularity: 21419th place
No tags for this snippet yet.
LanguageCoffeeScript
SourceGitHub
SourceMyGists

Atom autocomplete suggestions on tab

Atom autocomplete suggestions on tab: 
tab-completion.coffee
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1451348/Atom-autocomplete-suggestions-on-tab?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
{Point} = require 'atom' atom.commands.add 'atom-text-editor', 'custom:tabcomplete', (e) -> editor = atom.workspace.getActiveTextEditor() cursor = editor.getLastCursor() {row, column} = cursor.getBufferPosition() precedingCharacter = editor.getTextInBufferRange([[row, column - 1], [row, column]]) if /\S/.test(precedingCharacter) autocomplete = atom.packages.getActivePackage('autocomplete-plus') return unless autocomplete? manager = autocomplete.mainModule.activate() manager.shouldDisplaySuggestions = true manager.findSuggestions(true) else e.abortKeyBinding()
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus