Move function around for better readability
@@ -27,6 +27,15 @@ def plugin_unloaded():
events.off(on_finished_linting)
+@events.on(events.BEGIN_LINTING)
+def on_begin_linting(vid):
+ State['running'][vid] = time.time()
+
+ active_view = State['active_view']
+ if active_view and active_view.id() == vid:
+ draw(**State)
+
+
@events.on(events.FINISHED_LINTING)
def on_finished_linting(vid):
State['running'].pop(vid, None)
@@ -40,15 +49,6 @@ def on_finished_linting(vid):
draw(**State)
-@events.on(events.BEGIN_LINTING)
-def on_begin_linting(vid):
- State['running'][vid] = time.time()
-
- active_view = State['active_view']
- if active_view and active_view.id() == vid:
- draw(**State)
-
-
class UpdateState(sublime_plugin.EventListener):
def on_activated_async(self, view):
active_view = util.get_focused_view(view)
