gornostal / Modific

Highlight lines changed since the last commit (supports Git, SVN, Bazaar, Mercurial and TFS) / ST2(3) plugin
614 stars 44 forks source link

hl_changes in thread #13

Closed graarh closed 12 years ago

graarh commented 12 years ago

Hi. I edit files over sshfs mostly. Git can work for a several seconds or even a minute on it. Without additional thread, "hl_changes" command hangs sublime for this time.

gornostal commented 12 years ago

I'm getting an error on my Windows machine :(

Exception in thread Thread-26:
Traceback (most recent call last):
  File ".\threading.py", line 532, in __bootstrap_inner
  File ".\threading.py", line 484, in run
  File ".\Modific.py", line 433, in run_hl_changes
    view.run_command('hl_changes')
RuntimeError: Must call on main thread, consider using sublime.set_timeout(function, timeout)
gornostal commented 12 years ago

I replaced view.run_command('hl_changes') with sublime.set_timeout(lambda: view.run_command('hl_changes'), 0) Now it works. But this will run view.run_command on main thread and you will probably get the same result as before.

Try to pull my branch graarh-master. If you will be satisfied with the result, I merge this to the master.