mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
sending actions when switching between files
This commit is contained in:
parent
75b64c58e2
commit
b5b76ffb1f
@ -76,17 +76,19 @@ class WakatimeListener(sublime_plugin.EventListener):
|
||||
|
||||
def on_activated(self, view):
|
||||
now = time.time()
|
||||
if enough_time_passed(now):
|
||||
targetFile = view.file_name()
|
||||
if enough_time_passed(now) or targetFile != LAST_FILE:
|
||||
if away(now):
|
||||
api(view.file_name(), LAST_ACTION, endtime=now)
|
||||
api(targetFile, LAST_ACTION, endtime=now)
|
||||
else:
|
||||
api(view.file_name(), now)
|
||||
api(targetFile, now)
|
||||
|
||||
def on_selection_modified(self, view):
|
||||
now = time.time()
|
||||
if enough_time_passed(now):
|
||||
targetFile = view.file_name()
|
||||
if enough_time_passed(now) or targetFile != LAST_FILE:
|
||||
if away(now):
|
||||
api(view.file_name(), LAST_ACTION, endtime=now)
|
||||
api(targetFile, LAST_ACTION, endtime=now)
|
||||
else:
|
||||
api(view.file_name(), now)
|
||||
api(targetFile, now)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user