[gnome-builder] snippets: but don't break non-prefixed lines.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippets: but don't break non-prefixed lines.
- Date: Mon, 8 Sep 2014 02:37:17 +0000 (UTC)
commit bb27866ed1a0dcbfa6e79ab72830dc82005b1399
Author: Christian Hergert <christian hergert me>
Date: Sun Sep 7 19:37:07 2014 -0700
snippets: but don't break non-prefixed lines.
src/editor/gb-source-view.c | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/src/editor/gb-source-view.c b/src/editor/gb-source-view.c
index f16fe8a..b263d10 100644
--- a/src/editor/gb-source-view.c
+++ b/src/editor/gb-source-view.c
@@ -371,25 +371,28 @@ gb_source_view_get_line_prefix (GbSourceView *view,
str = g_string_new (NULL);
- do
+ if (gtk_text_iter_compare (&begin, iter) != 0)
{
- gunichar c;
+ do
+ {
+ gunichar c;
- c = gtk_text_iter_get_char (&begin);
+ c = gtk_text_iter_get_char (&begin);
- switch (c)
- {
- case '\t':
- case ' ':
- g_string_append_unichar (str, c);
- break;
- default:
- g_string_append_c (str, ' ');
- break;
+ switch (c)
+ {
+ case '\t':
+ case ' ':
+ g_string_append_unichar (str, c);
+ break;
+ default:
+ g_string_append_c (str, ' ');
+ break;
+ }
}
+ while (gtk_text_iter_forward_char (&begin) &&
+ (gtk_text_iter_compare (&begin, iter) < 0));
}
- while (gtk_text_iter_forward_char (&begin) &&
- (gtk_text_iter_compare (&begin, iter) < 0));
return g_string_free (str, FALSE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]