summaryrefslogtreecommitdiff
path: root/plugins/alias.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-08-21 15:27:53 +0200
committermathieui <mathieui@mathieui.net>2016-08-21 15:39:30 +0200
commit84e59b05ff0a17178da9ecdb6c5d084e48b42763 (patch)
tree224948d7c3d49a0005bff9390260357b3ec9c60e /plugins/alias.py
parent6c270b363ac018dfd4d66b23af95efcc35610da0 (diff)
downloadpoezio-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 'plugins/alias.py')
-rw-r--r--plugins/alias.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/alias.py b/plugins/alias.py
index 839fa3d8..108fde54 100644
--- a/plugins/alias.py
+++ b/plugins/alias.py
@@ -66,6 +66,7 @@ Example of the syntax:
from poezio.plugin import BasePlugin
from poezio.common import shell_split
+from poezio.core.structs import Completion
class Plugin(BasePlugin):
@@ -140,7 +141,7 @@ class Plugin(BasePlugin):
"Completion for /unalias"
aliases = [alias for alias in self.commands]
aliases.sort()
- return the_input.auto_completion(aliases, '', quotify=False)
+ return Completion(the_input.auto_completion, aliases, '', quotify=False)
def get_command(self, name):
"""Returns the function associated with a command"""