Home Download Buy Blog Forum Support

API doc out-of-date?

API doc out-of-date?

Postby misterade on Fri Apr 19, 2013 8:13 pm

Hello everybody, I'm new to the forum and the ST2 plugin developing although I have been using ST2 for a while now.
I was looking to the source of a plugin when I realised that the
Code: Select all
run_command
function can't be called inside a thread to run another command of the same plugin.
Looking in the forum I found the function
Code: Select all
sublime_plugin.run_timed_function
which seems do the trick but is not reported in the official API documentation and I wonder why.
Is the documentation out-of-date?
Should I refer to a different doc?

Thank you ;)
misterade
 
Posts: 3
Joined: Fri Apr 19, 2013 7:45 pm

Re: API doc out-of-date?

Postby FichteFoll on Thu May 16, 2013 2:10 am

The function you are searching for is:
Code: Select all
sublime.set_timeout(callback, timeout)

timout in ms. This function is documented.

Code: Select all
sublime_plugin.run_timed_function
simply wraps the callback in a time diff block that will display an error message when the diff is too high (the "A plugin may be making Sublime Text unresponsive" message from event listeners). It won't solve your thread issues. Also, it is ST2 only and the ST3 API in general is thread-safe.
FichteFoll
 
Posts: 383
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests