diff options
author | mathieui <mathieui@mathieui.net> | 2016-08-21 15:27:53 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2016-08-21 15:39:30 +0200 |
commit | 84e59b05ff0a17178da9ecdb6c5d084e48b42763 (patch) | |
tree | 224948d7c3d49a0005bff9390260357b3ec9c60e /poezio/plugin_manager.py | |
parent | 6c270b363ac018dfd4d66b23af95efcc35610da0 (diff) | |
download | poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.gz poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.bz2 poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.xz poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.zip |
Don’t call input completion() functions inside completion methods
Use a placeholder object that can run it afterwards, so that we don’t
have side effects inside those functions.
Diffstat (limited to 'poezio/plugin_manager.py')
-rw-r--r-- | poezio/plugin_manager.py | 6 |
1 files changed, 3 insertions, 3 deletions
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): |