Skip to content

Fix Gedit>44 compat #15

Closed
Closed
@ahmubashshir

Description

Gedit 45 removed tab parameter from active-tab-changed event.

diff --git a/gedit_wakatime/plugin.py b/gedit_wakatime/plugin.py
index e8598c0..55794df 100644
--- a/gedit_wakatime/plugin.py
+++ b/gedit_wakatime/plugin.py
@@ -49,7 +49,11 @@ class WakatimePlugin(GObject.Object, Gedit.WindowActivatable):
             return None
         return location.get_path()
 
-    def on_active_tab_changed(self, window, tab):
+    def on_active_tab_changed(self, window, tab=None):
+        tab = tab if tab else self.window.get_active_tab()
+        if not tab:
+            return
+
         document = tab.get_document()
         self._bind_document(document)
 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions