From ba7ee1d76c059a4d921a8f62e680dcf8d16adfa6 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 13 Nov 2011 18:45:44 +0100 Subject: Tweak auto_completion in order to add quotes only when needed --- src/windows.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/windows.py') 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: -- cgit v1.2.3