[gtk+] inspector: Always underline at least one char



commit 036ee7a68bd358be62e5ac36e8bdebe5b28b5b78
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Nov 20 20:58:42 2015 -0500

    inspector: Always underline at least one char
    
    Empty underlines are hard to make out. Since we get somewhat
    unreliable section information from the CSS parser, we just
    make sure that we always underline at least one character.

 gtk/inspector/css-editor.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c
index 714e4f9..d554784 100644
--- a/gtk/inspector/css-editor.c
+++ b/gtk/inspector/css-editor.c
@@ -337,6 +337,9 @@ show_parsing_error (GtkCssProvider        *provider,
   else
     tag_name = "error";
 
+  if (gtk_text_iter_equal (&css_error->start, &css_error->end))
+    gtk_text_iter_forward_char (&css_error->end);
+
   gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &css_error->start, &css_error->end);
 
   ce->priv->errors = g_list_prepend (ce->priv->errors, css_error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]