summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-10-01 20:46:20 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-10-01 20:46:20 +0200
commit347733804f8d61a01bc0a286f6f872f8dd14527d (patch)
tree055af65e51e4f2524a231d89c6a3cd83093f3a87 /src/tabs.py
parentd02c764c477d900487a97f648260612046257a17 (diff)
downloadpoezio-347733804f8d61a01bc0a286f6f872f8dd14527d.tar.gz
poezio-347733804f8d61a01bc0a286f6f872f8dd14527d.tar.bz2
poezio-347733804f8d61a01bc0a286f6f872f8dd14527d.tar.xz
poezio-347733804f8d61a01bc0a286f6f872f8dd14527d.zip
Do not try to cycle completion on commands if there was only one possibily.
You can now see by the space appended at the end if it was the only one. It lets you complete arguments without having to add a stupid space after the command name
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 1b6aeb7c..fbcfc597 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -125,7 +125,13 @@ class Tab(object):
# complete the command's name
words = ['/%s'% (name) for name in self.core.commands] +\
['/%s' % (name) for name in self.commands]
- the_input.auto_completion(words, ' ')
+ the_input.auto_completion(words, '')
+ # Do not try to cycle command completion if there was only
+ # one possibily. The next tab will complete the argument.
+ # Otherwise we would need to add a useless space before being
+ # able to complete the arguments.
+ if len(the_input.hit_list) == 1:
+ the_input.do_command(' ')
return True
return False
@@ -600,7 +606,7 @@ class MucTab(ChatTab):
def completion_topic(self, the_input):
current_topic = self.get_room().topic
- return the_input.auto_completion([current_topic], ' ')
+ return the_input.auto_completion([current_topic], '')
def command_kick(self, arg):
"""