Skip to content

Commit

Permalink
Tweak event logic
Browse files Browse the repository at this point in the history
Ref #164
  • Loading branch information
facelessuser committed Feb 20, 2021
1 parent b96c9ce commit 2ff9e0f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions color_helper_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ def __init__(self):
def reset(self):
"""Reset the thread variables."""
self.wait_time = 0.12
self.scroll_wait_time = 0.5
self.sleep = 0.25
self.time = time()
self.modified = False
self.ignore_all = False
Expand Down Expand Up @@ -540,14 +542,12 @@ def run(self):

while not self.abort:
if not self.ignore_all:
if (
(self.modified is True or self.scroll is True is True) and
(time() - self.time) > self.wait_time
):
delta = time() - self.time
if delta > self.wait_time and (self.modified is True or self.scroll is True):
sublime.set_timeout_async(self.payload, 0)
else:
elif delta > self.scroll_wait_time:
sublime.set_timeout_async(self.scroll_check, 0)
sleep(0.5)
sleep(self.sleep)


class ColorHelperListener(sublime_plugin.EventListener):
Expand Down

0 comments on commit 2ff9e0f

Please sign in to comment.