Home Download Buy Blog Forum Support

How to show pre-defined completions

How to show pre-defined completions

Postby guillermooo on Thu Apr 15, 2010 10:36 am

Can we use tmPreferences too or is it required to write a plugin?
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: How to show pre-defined completions

Postby jps on Thu Apr 15, 2010 1:42 pm

It has to be done via the API, something along the lines of:

Code: Select all
from AutoComplete import AutoCompleteCommand

def sampleCompletions(view, pos, prefix, completions):
   return ["xyzzy", "idkfa"] + completions

AutoCompleteCommand.completionCallbacks['sampleCompletions'] = sampleCompletions
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 17 guests