From 1a645064195829771752cecc9f27d978d7a99579 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 4 Jan 2010 18:45:21 +0100 Subject: [PATCH] Fix nick completion in MUC when it's not at the beginin of what is said. Fixes #5353 --- src/groupchat_control.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 71f3cf3ac..8982a6f5d 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -1833,12 +1833,14 @@ class GroupchatControl(ChatControlBase): gc_refer_to_nick_char = gajim.config.get('gc_refer_to_nick_char') with_refer_to_nick_char = False + after_nick_len = 1 # the space that is printed after we type [Tab] # first part of this if : works fine even if refer_to_nick_char if gc_refer_to_nick_char and begin.endswith(gc_refer_to_nick_char): with_refer_to_nick_char = True + after_nick_len = len(gc_refer_to_nick_char + ' ') if len(self.nick_hits) and self.last_key_tabs and \ - text[:-len(gc_refer_to_nick_char + ' ')].endswith(self.nick_hits[0]): + text[:-after_nick_len].endswith(self.nick_hits[0]): # we should cycle # Previous nick in list may had a space inside, so we check text and # not splitted_text and store it into 'begin' var