sending actions when switching between files
This commit is contained in:
parent
75b64c58e2
commit
b5b76ffb1f
1 changed files with 8 additions and 6 deletions
|
@ -76,17 +76,19 @@ class WakatimeListener(sublime_plugin.EventListener):
|
||||||
|
|
||||||
def on_activated(self, view):
|
def on_activated(self, view):
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if enough_time_passed(now):
|
targetFile = view.file_name()
|
||||||
|
if enough_time_passed(now) or targetFile != LAST_FILE:
|
||||||
if away(now):
|
if away(now):
|
||||||
api(view.file_name(), LAST_ACTION, endtime=now)
|
api(targetFile, LAST_ACTION, endtime=now)
|
||||||
else:
|
else:
|
||||||
api(view.file_name(), now)
|
api(targetFile, now)
|
||||||
|
|
||||||
def on_selection_modified(self, view):
|
def on_selection_modified(self, view):
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if enough_time_passed(now):
|
targetFile = view.file_name()
|
||||||
|
if enough_time_passed(now) or targetFile != LAST_FILE:
|
||||||
if away(now):
|
if away(now):
|
||||||
api(view.file_name(), LAST_ACTION, endtime=now)
|
api(targetFile, LAST_ACTION, endtime=now)
|
||||||
else:
|
else:
|
||||||
api(view.file_name(), now)
|
api(targetFile, now)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue