[Xfce4-commits] [apps/mousepad] 01/01: Fix gtksourceview warnings/errors (Bug 11663)

noreply at xfce.org noreply at xfce.org
Thu Apr 25 02:23:53 CEST 2019


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/mousepad.

commit 9eca13db68144c9f4e57f08e711e4d2963fa4c4c
Author: Andre Miranda <andreldm at xfce.org>
Date:   Wed Apr 24 21:23:39 2019 -0300

    Fix gtksourceview warnings/errors (Bug 11663)
---
 mousepad/mousepad-view.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/mousepad/mousepad-view.c b/mousepad/mousepad-view.c
index bbc569f..802f116 100644
--- a/mousepad/mousepad-view.c
+++ b/mousepad/mousepad-view.c
@@ -255,18 +255,30 @@ mousepad_view_buffer_changed (MousepadView *view,
                               gpointer      user_data)
 {
   GtkSourceBuffer *buffer;
-
   buffer = (GtkSourceBuffer*) gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+
   if (GTK_SOURCE_IS_BUFFER (buffer))
     {
       GtkSourceStyleSchemeManager *manager;
       GtkSourceStyleScheme        *scheme;
+      gboolean enable_highlight = TRUE;
 
       manager = gtk_source_style_scheme_manager_get_default ();
       scheme = gtk_source_style_scheme_manager_get_scheme (manager,
         view->color_scheme ? view->color_scheme : "");
-      gtk_source_buffer_set_style_scheme (buffer, scheme);
 
+#ifdef GTK_SOURCE_CHECK_VERSION
+#if GTK_SOURCE_CHECK_VERSION (3, 21, 0)
+      if (!GTK_SOURCE_IS_STYLE_SCHEME (scheme))
+      {
+        scheme = gtk_source_style_scheme_manager_get_scheme (manager, "classic");
+        enable_highlight = FALSE;
+      }
+#endif
+#endif
+
+      gtk_source_buffer_set_style_scheme (buffer, scheme);
+      gtk_source_buffer_set_highlight_syntax (buffer, enable_highlight);
       gtk_source_buffer_set_highlight_matching_brackets (buffer, view->match_braces);
     }
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list