diff options
author | wurstsalat <mailtrash@posteo.de> | 2022-08-15 13:22:49 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2022-08-15 22:34:55 +0300 |
commit | 4113f9e71a19a687a6abd5388c106354b3bb8108 (patch) | |
tree | 0ad7f7ef5fec514bdddb8cdf002abec020de172a | |
parent | a38757800ff6298685d6472c7dcbf592588b5cb1 (diff) |
fix: MessageInputTextView: Account for having multiple blocks when applying style
Fixes #11015
-rw-r--r-- | gajim/gtk/message_input.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gajim/gtk/message_input.py b/gajim/gtk/message_input.py index ff2c6f72a..5aff862c1 100644 --- a/gajim/gtk/message_input.py +++ b/gajim/gtk/message_input.py @@ -175,8 +175,10 @@ class MessageInputTextView(Gtk.TextView): for block in result.blocks: if isinstance(block, PlainBlock): for span in block.spans: - start_iter = buf.get_iter_at_offset(span.start) - end_iter = buf.get_iter_at_offset(span.end) + start_iter = buf.get_iter_at_offset( + span.start + block.start) + end_iter = buf.get_iter_at_offset( + span.end + block.start) buf.apply_tag_by_name(span.name, start_iter, end_iter) def insert_text(self, text: str) -> None: |