summaryrefslogtreecommitdiff
path: root/src/plugin.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-13 20:17:33 +0100
committermathieui <mathieui@mathieui.net>2011-11-13 20:17:33 +0100
commit338a4b571711dcdd3ad523ad8e27a99d3b7d403c (patch)
treef425c382ad4761b56f736acc5f68ee224b512d99 /src/plugin.py
parent68d25ec4ef81053b4770e3981f4ebe013a331c05 (diff)
downloadpoezio-338a4b571711dcdd3ad523ad8e27a99d3b7d403c.tar.gz
poezio-338a4b571711dcdd3ad523ad8e27a99d3b7d403c.tar.bz2
poezio-338a4b571711dcdd3ad523ad8e27a99d3b7d403c.tar.xz
poezio-338a4b571711dcdd3ad523ad8e27a99d3b7d403c.zip
Add a way for a plugin to add a keybind only for a type of tab
Diffstat (limited to 'src/plugin.py')
-rw-r--r--src/plugin.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugin.py b/src/plugin.py
index ddc3253e..15f7d1cf 100644
--- a/src/plugin.py
+++ b/src/plugin.py
@@ -108,6 +108,18 @@ class BasePlugin(object, metaclass=SafetyMetaclass):
"""
return self.plugin_manager.del_key(self.__module__, key)
+ def add_tab_key(self, tab_type, key, handler):
+ """
+ Add a keybind only for a type of tab.
+ """
+ return self.plugin_manager.add_tab_key(self.__module__, tab_type, key, handler)
+
+ def del_tab_key(self, tab_type, key):
+ """
+ Remove a keybind added through add_tab_key.
+ """
+ return self.plugin_manager.del_tab_key(self.__module__, tab_type, key)
+
def add_tab_command(self, tab_type, name, handler, help, completion=None):
"""
Add a command only for a type of tab.