Tab in empty message textview cycles all nicknames in the room. Fixes #1933
This commit is contained in:
parent
794023af0f
commit
8fcd0a6c8d
1 changed files with 35 additions and 37 deletions
|
@ -1296,10 +1296,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
cursor_position = message_buffer.get_insert()
|
cursor_position = message_buffer.get_insert()
|
||||||
end_iter = message_buffer.get_iter_at_mark(cursor_position)
|
end_iter = message_buffer.get_iter_at_mark(cursor_position)
|
||||||
text = message_buffer.get_text(start_iter, end_iter, False).decode('utf-8')
|
text = message_buffer.get_text(start_iter, end_iter, False).decode('utf-8')
|
||||||
if not text or text.endswith(' '):
|
|
||||||
# if we are nick cycling, last char will always be space
|
|
||||||
if not self.last_key_tabs:
|
|
||||||
return False
|
|
||||||
|
|
||||||
splitted_text = text.split()
|
splitted_text = text.split()
|
||||||
# command completion
|
# command completion
|
||||||
|
@ -1328,6 +1324,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
# check if tab is pressed with empty message
|
# check if tab is pressed with empty message
|
||||||
if len(splitted_text): # if there are any words
|
if len(splitted_text): # if there are any words
|
||||||
begin = splitted_text[-1] # last word we typed
|
begin = splitted_text[-1] # last word we typed
|
||||||
|
else:
|
||||||
|
begin = ''
|
||||||
|
|
||||||
if len(self.nick_hits) and \
|
if len(self.nick_hits) and \
|
||||||
self.nick_hits[0].startswith(begin.replace(
|
self.nick_hits[0].startswith(begin.replace(
|
||||||
|
|
Loading…
Add table
Reference in a new issue