A bunch of fixes for the command completion
This commit is contained in:
parent
39eef45bca
commit
e0e4dd6c31
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue