Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwurstsalat <mailtrash@posteo.de>2021-10-18 21:35:51 +0300
committerwurstsalat <mailtrash@posteo.de>2021-10-18 21:35:51 +0300
commit761a3eda0e7948df7f64687ede607edcf97ab095 (patch)
tree5130fd16c97c419f6d8890070d9df6a760564d9f
parent7b28c178e8eba84b72a2fdb1fead89822895d645 (diff)
[syntax_highlight] Fix placeholder issue with Gajim >=1.3.2
Fixes #569
-rw-r--r--syntax_highlight/chat_syntax_highlighter.py6
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)