[gtksourceview] SpaceDrawer: replace comment by self-documented code
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] SpaceDrawer: replace comment by self-documented code
- Date: Sat, 23 Jul 2016 07:20:20 +0000 (UTC)
commit c6bad6e2265209a9e9dd1b4f73995f39df43bbe0
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Jul 23 09:00:26 2016 +0200
SpaceDrawer: replace comment by self-documented code
gtksourceview/gtksourcespacedrawer.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcespacedrawer.c b/gtksourceview/gtksourcespacedrawer.c
index 3adc458..fc0edbc 100644
--- a/gtksourceview/gtksourcespacedrawer.c
+++ b/gtksourceview/gtksourcespacedrawer.c
@@ -183,6 +183,12 @@ is_nbsp (gunichar ch)
}
static inline gboolean
+is_narrowed_nbsp (gunichar ch)
+{
+ return ch == 0x202F;
+}
+
+static inline gboolean
is_space (gunichar ch)
{
return g_unichar_type (ch) == G_UNICODE_SPACE_SEPARATOR;
@@ -335,8 +341,7 @@ draw_whitespace_at_iter (GtkTextView *text_view,
}
else if (is_nbsp (ch))
{
- /* We also need to check if we want to draw a narrowed space */
- draw_nbsp_at_pos (cr, rect, ch == 0x202F);
+ draw_nbsp_at_pos (cr, rect, is_narrowed_nbsp (ch));
}
else if (is_space (ch))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]