From 829fb64dea4a8ea62251fe1cea0970830f192e77 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 20 Jun 2005 08:14:06 +0000 Subject: [PATCH] add a space at the end of command when we use completion --- src/groupchat_window.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/groupchat_window.py b/src/groupchat_window.py index af4f25253..6168a7b41 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -393,8 +393,10 @@ class GroupchatWindow(chat.Chat): if not self.last_key_tabs[room_jid]: # if we are nick cycling, last char will always be space return False + splitted_text = text.split() # command completion - if text.startswith('/') and len(text.split()) == 1: + if text.startswith('/') and len(splitted_text) == 1: + text = splitted_text[0] if len(text) == 1: # user wants to cycle all commands self.cmd_hits[room_jid] = self.muc_cmds else: @@ -411,12 +413,11 @@ class GroupchatWindow(chat.Chat): if len(self.cmd_hits[room_jid]): message_buffer.delete(start_iter, end_iter) message_buffer.insert_at_cursor('/' + \ - self.cmd_hits[room_jid][0]) + self.cmd_hits[room_jid][0] + ' ') self.last_key_tabs[room_jid] = True return True # nick completion - splitted_text = text.split() # check if tab is pressed with empty message if len(splitted_text): # if there are any words begin = splitted_text[-1] # last word we typed