fix #278
This commit is contained in:
parent
41e7d106d8
commit
80144824b0
|
@ -283,7 +283,7 @@ class Groupchat_window(chat.Chat):
|
|||
def on_message_textview_key_press_event(self, widget, event):
|
||||
"""When a key is pressed:
|
||||
if enter is pressed without the shit key, message (if not empty) is sent
|
||||
and printed in the conversation. Tab does autocompete in nickames"""
|
||||
and printed in the conversation. Tab does autocomplete in nickames"""
|
||||
room_jid = self.get_active_jid()
|
||||
conversation_textview = self.xmls[room_jid].get_widget(
|
||||
'conversation_textview')
|
||||
|
@ -300,10 +300,10 @@ class Groupchat_window(chat.Chat):
|
|||
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, 0)
|
||||
if not text:
|
||||
if not text or text.endswith(' '):
|
||||
return False
|
||||
splitted_text = text.split()
|
||||
begin = splitted_text[-1] # begining of the latest word we typed
|
||||
begin = splitted_text[-1] # last word we typed
|
||||
for nick in list_nick:
|
||||
if nick.find(begin) == 0: # the word is the begining of a nick
|
||||
if len(splitted_text) == 1: # This is the 1st word of the line
|
||||
|
|
Loading…
Reference in New Issue