summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-13 18:45:44 +0100
committermathieui <mathieui@mathieui.net>2011-11-13 18:45:44 +0100
commitba7ee1d76c059a4d921a8f62e680dcf8d16adfa6 (patch)
tree64415a46a16440354b6ecb247b944aa3843c2c79 /src
parent587a74df6ea7b2e6bbca4c3e1eec5c096309cb7c (diff)
downloadpoezio-ba7ee1d76c059a4d921a8f62e680dcf8d16adfa6.tar.gz
poezio-ba7ee1d76c059a4d921a8f62e680dcf8d16adfa6.tar.bz2
poezio-ba7ee1d76c059a4d921a8f62e680dcf8d16adfa6.tar.xz
poezio-ba7ee1d76c059a4d921a8f62e680dcf8d16adfa6.zip
Tweak auto_completion in order to add quotes only when needed
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py2
-rw-r--r--src/windows.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/tabs.py b/src/tabs.py
index feb4be37..27c23e95 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -905,7 +905,7 @@ class MucTab(ChatTab):
add_after = after
else:
add_after = ' '
- self.input.auto_completion(word_list, add_after)
+ self.input.auto_completion(word_list, add_after, quotify=False)
empty_after = self.input.get_text() == '' or (self.input.get_text().startswith('/') and not self.input.get_text().startswith('//'))
self.send_composing_chat_state(empty_after)
diff --git a/src/windows.py b/src/windows.py
index c156863e..bbae1ab7 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -940,7 +940,7 @@ class Input(Win):
self.rewrite_text()
return True
- def auto_completion(self, word_list, add_after):
+ def auto_completion(self, word_list, add_after, quotify=True):
"""
Complete the input, from a list of words
if add_after is None, we use the value defined in completion
@@ -948,9 +948,10 @@ class Input(Win):
completion (with no additional space)
"""
completion_type = config.get('completion', 'normal')
- for i, word in enumerate(word_list[:]):
- if ' ' in word:
- word_list[i] = '"' + word + '"'
+ if quotify:
+ for i, word in enumerate(word_list[:]):
+ if ' ' in word:
+ word_list[i] = '"' + word + '"'
if completion_type == 'shell' and self.text != '':
self.shell_completion(word_list, add_after)
else: