A bunch of fixes for the command completion

This commit is contained in:
red-agent 2009-09-17 19:06:38 +03:00
parent 39eef45bca
commit e0e4dd6c31
2 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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)