From acaad2dc83ce8c03fbe047e2e7dd341b9a4b02a3 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Wed, 6 May 2015 14:00:33 -0700 Subject: [PATCH] only send heartbeats for the currently active buffer, for cases where another process modifies files which are open in sublime text --- WakaTime.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WakaTime.py b/WakaTime.py index a8041ec..57866e1 100644 --- a/WakaTime.py +++ b/WakaTime.py @@ -288,10 +288,12 @@ class WakatimeListener(sublime_plugin.EventListener): handle_heartbeat(view, is_write=True) def on_selection_modified(self, view): - handle_heartbeat(view) + if sublime.active_window().active_view().buffer_id() == view.buffer_id(): + handle_heartbeat(view) def on_modified(self, view): - handle_heartbeat(view) + if sublime.active_window().active_view().buffer_id() == view.buffer_id(): + handle_heartbeat(view) class WakatimeDashboardCommand(sublime_plugin.ApplicationCommand):