I'm trying to use set_timeout_async to run potentially time consuming code which ultimately inserts into a new scratch view. Something like...
- Code: Select all
def run(self, edit):
self.edit = edit
def doit(self, *args, **kargs):
## LONG RUNNING CODE HERE
n = self.view.window().new_file()
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?