Skip to content

Commit

Permalink
refactoring scanning conditions
Browse files Browse the repository at this point in the history
shmuelfomberg committed Jul 14, 2014
1 parent e262119 commit efe8d1e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions perlidx.py
Original file line number Diff line number Diff line change
@@ -67,13 +67,9 @@ def deferred_get_list(view, t):
return
view_rec = views[view.id()]
changed = view_rec['changed']
if time.time() > view_rec['last_scaned'] + 10:
subs = get_subs_list(view)
GetCurrentSub(view, subs)
elif changed > t:
new_delay = changed + 2 - time.time()
func = lambda: deferred_get_list(view, changed)
sublime.set_timeout(func, new_delay)
last_scaned = view_rec['last_scaned']
if (t < last_scaned) or (changed > t):
return
else:
subs = get_subs_list(view)
GetCurrentSub(view, subs)

0 comments on commit efe8d1e

Please sign in to comment.