about summary refs log tree commit diff stats
path: root/src/plugins/python_api.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-04 23:14:08 +0100
committerJames Booth <boothj5@gmail.com>2016-07-04 23:14:08 +0100
commitfd218ac3e443650a7b310d4f8cde758f08c0ed8c (patch)
treedc1efd227324d8d9aef9a7e6fd5a808a08c67ab3 /src/plugins/python_api.c
parent03c7ac73fd903a6c48658fd3c5e270d35f5a80c2 (diff)
downloadprofani-tty-fd218ac3e443650a7b310d4f8cde758f08c0ed8c.tar.gz
Pass plugin name to all autocompleter functions
Diffstat (limited to 'src/plugins/python_api.c')
-rw-r--r--src/plugins/python_api.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c
index 82cf22eb..6f478893 100644
--- a/src/plugins/python_api.c
+++ b/src/plugins/python_api.c
@@ -242,6 +242,9 @@ python_api_completer_remove(PyObject *self, PyObject *args)
         return Py_BuildValue("");
     }
 
+    char *plugin_name = _python_plugin_name();
+    log_debug("Autocomplete remove %s for %s", key, plugin_name);
+
     Py_ssize_t len = PyList_Size(items);
     char *c_items[len];
 
@@ -254,9 +257,11 @@ python_api_completer_remove(PyObject *self, PyObject *args)
     c_items[len] = NULL;
 
     allow_python_threads();
-    api_completer_remove(key, c_items);
+    api_completer_remove(plugin_name, key, c_items);
     disable_python_threads();
 
+    free(plugin_name);
+
     return Py_BuildValue("");
 }
 
@@ -269,10 +274,15 @@ python_api_completer_clear(PyObject *self, PyObject *args)
         return Py_BuildValue("");
     }
 
+    char *plugin_name = _python_plugin_name();
+    log_debug("Autocomplete clear %s for %s", key, plugin_name);
+
     allow_python_threads();
-    api_completer_clear(key);
+    api_completer_clear(plugin_name, key);
     disable_python_threads();
 
+    free(plugin_name);
+
     return Py_BuildValue("");
 }