Tab in empty message textview cycles all nicknames in the room. Fixes #1933

This commit is contained in:
Yann Leboulanger 2006-05-06 19:43:43 +00:00
parent 794023af0f
commit 8fcd0a6c8d

View file

@ -1296,10 +1296,6 @@ class GroupchatControl(ChatControlBase):
cursor_position = message_buffer.get_insert()
end_iter = message_buffer.get_iter_at_mark(cursor_position)
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()
# command completion
@ -1328,6 +1324,8 @@ class GroupchatControl(ChatControlBase):
# check if tab is pressed with empty message
if len(splitted_text): # if there are any words
begin = splitted_text[-1] # last word we typed
else:
begin = ''
if len(self.nick_hits) and \
self.nick_hits[0].startswith(begin.replace(