diff options
-rw-r--r-- | syntax_highlight/chat_syntax_highlighter.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/syntax_highlight/chat_syntax_highlighter.py b/syntax_highlight/chat_syntax_highlighter.py index f32541a..bb80050 100644 --- a/syntax_highlight/chat_syntax_highlighter.py +++ b/syntax_highlight/chat_syntax_highlighter.py @@ -1,5 +1,6 @@ import logging import re +from packaging.version import Version as V import pygments from pygments.token import Comment from pygments.styles import get_style_by_name @@ -7,6 +8,8 @@ from pygments.styles import get_style_by_name from gi.repository import Gtk from gi.repository import Gdk +import gajim + from gajim.plugins.plugins_i18n import _ from syntax_highlight.gtkformatter import GTKFormatter @@ -49,7 +52,8 @@ class ChatSyntaxHighlighter: return clipboard.wait_for_text() def _insert_paste(self, text): - self._chat_control.msg_textview.remove_placeholder() + if V(gajim.__version__) <= V('1.3.1'): + self._chat_control.msg_textview.remove_placeholder() message_buffer = self._chat_control.msg_textview.get_buffer() message_buffer.insert_at_cursor(text) |