From 84e59b05ff0a17178da9ecdb6c5d084e48b42763 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 21 Aug 2016 15:27:53 +0200 Subject: =?UTF-8?q?Don=E2=80=99t=20call=20input=20completion()=20functions?= =?UTF-8?q?=20inside=20completion=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a placeholder object that can run it afterwards, so that we don’t have side effects inside those functions. --- poezio/plugin_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'poezio/plugin_manager.py') diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py index 8e08432b..11584b23 100644 --- a/poezio/plugin_manager.py +++ b/poezio/plugin_manager.py @@ -10,7 +10,7 @@ from os import path import logging from poezio import tabs -from poezio.core.structs import Command +from poezio.core.structs import Command, Completion from poezio.plugin import PluginAPI from poezio.config import config @@ -284,7 +284,7 @@ class PluginManager(object): and name != '__init__.py' and not name.startswith('.')] plugins_files.sort() position = the_input.get_argument_position(quoted=False) - return the_input.new_completion(plugins_files, position, '', + return Completion(the_input.new_completion, plugins_files, position, '', quotify=False) def completion_unload(self, the_input): @@ -292,7 +292,7 @@ class PluginManager(object): completion function that completes the name of loaded plugins """ position = the_input.get_argument_position(quoted=False) - return the_input.new_completion(sorted(self.plugins.keys()), position, + return Completion(the_input.new_completion, sorted(self.plugins.keys()), position, '', quotify=False) def on_plugins_dir_change(self, new_value): -- cgit v1.2.3