From 0611f8d683560d9fad8877a1ca4f7208c39d88d2 Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Fri, 3 Nov 2023 22:07:18 +0100 Subject: fix: Emojis: Improve detection of shortcode start Fixes #11594 --- gajim/gtk/chat_action_processor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gajim/gtk/chat_action_processor.py b/gajim/gtk/chat_action_processor.py index 347d08fdb..f6fd4c949 100644 --- a/gajim/gtk/chat_action_processor.py +++ b/gajim/gtk/chat_action_processor.py @@ -233,9 +233,11 @@ class ChatActionProcessor(Gtk.Popover): action_text = self._buf.get_text( start, self._current_iter, False)[1:] - if self._start_mark is None: - self._start_mark = Gtk.TextMark.new('chat-action-start', True) - self._buf.add_mark(self._start_mark, start) + if self._start_mark is not None: + self._buf.delete_mark(self._start_mark) + + self._start_mark = Gtk.TextMark.new('chat-action-start', True) + self._buf.add_mark(self._start_mark, start) if self._active or len(action_text) > 1: # Don't activate until a sufficient # of chars has been typed, # which is chosen to be > 1 to not interfere with ASCII smilies -- cgit v1.2.3