Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
66a706f6 by wurstsalat at 2021-12-13T22:16:53+01:00
MessageInputTextView: Apply styling for plain blocks only

- - - - -


1 changed file:

- gajim/gtk/message_input.py


Changes:

=====================================
gajim/gtk/message_input.py
=====================================
@@ -108,10 +108,11 @@ def _on_text_changed(self, buffer_):
 
         result = process(text)
         for block in result.blocks:
-            for span in block.spans:
-                start_iter = buffer_.get_iter_at_offset(span.start)
-                end_iter = buffer_.get_iter_at_offset(span.end)
-                buffer_.apply_tag_by_name(span.name, start_iter, end_iter)
+            if block.name == 'plain':
+                for span in block.spans:
+                    start_iter = buffer_.get_iter_at_offset(span.start)
+                    end_iter = buffer_.get_iter_at_offset(span.end)
+                    buffer_.apply_tag_by_name(span.name, start_iter, end_iter)
 
     def insert_text(self, text: str) -> None:
         self.get_buffer().insert_at_cursor(text)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/66a706f67a790d42228a30a4f2e83db95c2fb1f9

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/66a706f67a790d42228a30a4f2e83db95c2fb1f9
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to