Hi all,
I’m trying to use set_timeout_async to run potentially time consuming code which ultimately inserts into a new scratch view. Something like…
class Something(sublime_plugin.TextCommand):
def run(self, edit):
self.edit = edit
sublime.set_timeout_async(self.doit, 100)
def doit(self, *args, **kargs):
## LONG RUNNING CODE HERE
n = self.view.window().new_file()
n.set_scratch(True)
n.insert(self.edit, 0, u'asdasd')
The new view is created, but the content (‘asdasd’) is not inserted. No error is logged. Is it not possible to insert into a view from a function called by set_timeout_async?