diff options
author | mathieui <mathieui@mathieui.net> | 2013-08-01 20:17:12 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-08-01 20:17:12 +0200 |
commit | bb59771d9962dcd69c29b008031fd4ae9002915d (patch) | |
tree | 4ce52e3e5fc99837ecc97113de299d5e142c12cd /src/plugin_manager.py | |
parent | 2744234d52016ae06f4c72193c5b1faebc57ddd1 (diff) | |
download | poezio-bb59771d9962dcd69c29b008031fd4ae9002915d.tar.gz poezio-bb59771d9962dcd69c29b008031fd4ae9002915d.tar.bz2 poezio-bb59771d9962dcd69c29b008031fd4ae9002915d.tar.xz poezio-bb59771d9962dcd69c29b008031fd4ae9002915d.zip |
Fix #2049 (get the current completed argument)
A command argument can now be completed even if it isn’t the last
one in the input.
- Add a new method Input.new_completion
Almost like the old auto_completion method, except taht it takes
another argument: argument_position, which is the argument to be
completed.
- Methods using the old completion method still work
- All completion methods in poezio now use the new one if necessary
- Further details can be found in the docstring of new_completion
Diffstat (limited to 'src/plugin_manager.py')
-rw-r--r-- | src/plugin_manager.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugin_manager.py b/src/plugin_manager.py index 9e253f97..5931d798 100644 --- a/src/plugin_manager.py +++ b/src/plugin_manager.py @@ -314,13 +314,13 @@ class PluginManager(object): plugins_files = [name[:-3] for name in names if name.endswith('.py') and name != '__init__.py' and not name.startswith('.')] plugins_files.sort() - return the_input.auto_completion(plugins_files, '', quotify=False) + return the_input.new_completion(plugins_files, 1, '', quotify=False) def completion_unload(self, the_input): """ completion function that completes the name of the plugins that are loaded """ - return the_input.auto_completion(list(self.plugins.keys()), '', quotify=False) + return the_input.new_completion(sorted(self.plugins.keys()), 1, '', quotify=False) def on_plugins_dir_change(self, new_value): global plugins_dir |