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 = buffer.get_text(start, end, False)
|
||||||
text = text.decode('utf8')
|
text = text.decode('utf8')
|
||||||
|
|
||||||
if (text.startswith(self.COMMAND_PREFIX) and not
|
splitted = text.split()
|
||||||
text.startswith(self.COMMAND_PREFIX * 2)):
|
|
||||||
|
|
||||||
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)
|
bare = text.lstrip(self.COMMAND_PREFIX)
|
||||||
|
|
||||||
if len(text) == 1:
|
if len(text) == 1:
|
||||||
|
@ -351,6 +353,7 @@ class ChatControlBase(MessageControl, CommonCommands):
|
||||||
self.msg_textview.grab_focus()
|
self.msg_textview.grab_focus()
|
||||||
|
|
||||||
self.command_hits = []
|
self.command_hits = []
|
||||||
|
self.last_key_tabs = False
|
||||||
|
|
||||||
def set_speller(self):
|
def set_speller(self):
|
||||||
# now set the one the user selected
|
# now set the one the user selected
|
||||||
|
|
|
@ -1785,7 +1785,7 @@ class GroupchatControl(ChatControlBase, GroupChatCommands):
|
||||||
|
|
||||||
# HACK: Not the best soltution.
|
# HACK: Not the best soltution.
|
||||||
if (text.startswith(self.COMMAND_PREFIX) and not
|
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,
|
return super(GroupchatControl,
|
||||||
self).handle_message_textview_mykey_press(widget, event_keyval,
|
self).handle_message_textview_mykey_press(widget, event_keyval,
|
||||||
event_keymod)
|
event_keymod)
|
||||||
|
|
Loading…
Reference in New Issue