[gnome-builder] indenter-c: add field to specify indentation for scope
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] indenter-c: add field to specify indentation for scope
- Date: Sat, 10 Oct 2015 04:49:57 +0000 (UTC)
commit fc3698e6e753c6429d704f4de63717fc671718a2
Author: Christian Hergert <chergert redhat com>
Date: Sat Oct 10 00:49:47 2015 -0400
indenter-c: add field to specify indentation for scope
This allows us to both indent, and unindent to current scope (0) as we
do currently with gnu style.
plugins/c-pack/ide-c-indenter.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/c-pack/ide-c-indenter.c b/plugins/c-pack/ide-c-indenter.c
index a2be5b4..0a3b62d 100644
--- a/plugins/c-pack/ide-c-indenter.c
+++ b/plugins/c-pack/ide-c-indenter.c
@@ -44,6 +44,7 @@ struct _IdeCIndenter
gint condition_indent;
gint directive_indent;
gint extra_label_indent;
+ gint case_indent;
};
static void indenter_iface_init (IdeIndenterInterface *iface);
@@ -1154,7 +1155,7 @@ maybe_unindent_case_label (IdeCIndenter *c,
str = g_string_new (NULL);
offset = GET_LINE_OFFSET (&iter);
- build_indent (c, offset, &iter, str);
+ build_indent (c, offset + c->case_indent, &iter, str);
while (!gtk_text_iter_starts_line (begin))
gtk_text_iter_backward_char (begin);
gtk_text_iter_assign (end, begin);
@@ -1338,6 +1339,7 @@ ide_c_indenter_init (IdeCIndenter *self)
self->pre_scope_indent = 2;
self->post_scope_indent = 2;
self->directive_indent = G_MININT;
+ self->case_indent = 0;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]