def run_after_loading(view, func):
 def run():
  if view.is_loading():
   sublime.set_timeout(run, 10)
  else:
   sublime.set_timeout(func, 10)
 run()

def run_after_loading ( view , func ) : def run ( ) : if view . is_loading ( ) : sublime . set_timeout ( run , 10 ) else : sublime . set_timeout ( func , 10 ) run ( )
run a function after the view has finished loading .