From fd218ac3e443650a7b310d4f8cde758f08c0ed8c Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 4 Jul 2016 23:14:08 +0100 Subject: Pass plugin name to all autocompleter functions --- src/plugins/python_api.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/plugins/python_api.c') 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(""); } -- cgit 1.4.1-2-gfad0