diff options
author | wurstsalat <mailtrash@posteo.de> | 2021-10-18 21:35:51 +0300 |
---|---|---|
committer | wurstsalat <mailtrash@posteo.de> | 2021-10-18 21:35:51 +0300 |
commit | 761a3eda0e7948df7f64687ede607edcf97ab095 (patch) | |
tree | 5130fd16c97c419f6d8890070d9df6a760564d9f | |
parent | 7b28c178e8eba84b72a2fdb1fead89822895d645 (diff) |
[syntax_highlight] Fix placeholder issue with Gajim >=1.3.2
Fixes #569
-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) |