From e0e4dd6c31e8de4f0fb317e08ce37b002bd7a397 Mon Sep 17 00:00:00 2001 From: red-agent Date: Thu, 17 Sep 2009 19:06:38 +0300 Subject: [PATCH] A bunch of fixes for the command completion --- src/chat_control.py | 9 ++++++--- src/groupchat_control.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 5aeba6248..6c4d613e3 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -164,10 +164,12 @@ class ChatControlBase(MessageControl, CommonCommands): text = buffer.get_text(start, end, False) text = text.decode('utf8') - if (text.startswith(self.COMMAND_PREFIX) and not - text.startswith(self.COMMAND_PREFIX * 2)): + splitted = text.split() - text = text.split()[0] + if (text.startswith(self.COMMAND_PREFIX) and not + text.startswith(self.COMMAND_PREFIX * 2) and len(splitted) == 1): + + text = splitted[0] bare = text.lstrip(self.COMMAND_PREFIX) if len(text) == 1: @@ -351,6 +353,7 @@ class ChatControlBase(MessageControl, CommonCommands): self.msg_textview.grab_focus() self.command_hits = [] + self.last_key_tabs = False def set_speller(self): # now set the one the user selected diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 4d6acf591..4cecf8c97 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -1785,7 +1785,7 @@ class GroupchatControl(ChatControlBase, GroupChatCommands): # HACK: Not the best soltution. if (text.startswith(self.COMMAND_PREFIX) and not - text.startswith(self.COMMAND_PREFIX * 2)): + text.startswith(self.COMMAND_PREFIX * 2) and len(splitted_text) == 1): return super(GroupchatControl, self).handle_message_textview_mykey_press(widget, event_keyval, event_keymod)