[gtksourceview] view: fix bug in draw_spaces_tag_foreach()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] view: fix bug in draw_spaces_tag_foreach()
- Date: Wed, 1 Jun 2016 14:04:18 +0000 (UTC)
commit 41b817f189bdec413a1598f99713be8491d9bdcb
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Jun 1 15:56:44 2016 +0200
view: fix bug in draw_spaces_tag_foreach()
The goal of the function is to find if a GtkSourceTag is present and
that uses the draw-spaces property. It must also return TRUE when
draw-spaces is FALSE, since when it is set, it overrides the global
setting.
There was no bugs in test-space-drawing because it worked by chance,
with the condition at where buffer_has_draw_spaces_tag() is called. But
in the future that code might be modified, or
buffer_has_draw_spaces_tag() could be used at another place, and a bug
would be introduced.
The function name buffer_has_draw_spaces_tag() is normally clear enough
in its meaning...
gtksourceview/gtksourceview.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 44adc3a..601555b 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2454,15 +2454,13 @@ draw_spaces_tag_foreach (GtkTextTag *tag,
if (GTK_SOURCE_IS_TAG (tag))
{
- gboolean draw_spaces;
gboolean draw_spaces_set;
g_object_get (tag,
- "draw-spaces", &draw_spaces,
"draw-spaces-set", &draw_spaces_set,
NULL);
- if (draw_spaces && draw_spaces_set)
+ if (draw_spaces_set)
{
*found = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]