[gnome-builder] auto-indent: fix indent when curly is not first char.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] auto-indent: fix indent when curly is not first char.
- Date: Fri, 26 Sep 2014 09:03:22 +0000 (UTC)
commit ad2a11f21306848771061e5b9038c0bbcdab7080
Author: Christian Hergert <christian hergert me>
Date: Fri Sep 26 02:03:16 2014 -0700
auto-indent: fix indent when curly is not first char.
Fixes things like:
enum { and typedef struct {
src/editor/gb-source-auto-indenter-c.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/editor/gb-source-auto-indenter-c.c b/src/editor/gb-source-auto-indenter-c.c
index 9a76a5e..dabb987 100644
--- a/src/editor/gb-source-auto-indenter-c.c
+++ b/src/editor/gb-source-auto-indenter-c.c
@@ -1127,6 +1127,7 @@ gb_source_auto_indenter_c_format (GbSourceAutoIndenter *indenter,
gtk_text_iter_assign (&iter, begin);
gtk_text_iter_backward_char (&iter);
gtk_text_iter_backward_char (&iter);
+ backward_to_line_first_char (&iter);
offset = gtk_text_iter_get_line_offset (&iter);
build_indent (c, offset, &iter, str);
g_string_prepend (str, "\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]