[gnome-builder/auto-indent] auto-indent: stub out format callback post-trigger.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/auto-indent] auto-indent: stub out format callback post-trigger.
- Date: Thu, 18 Sep 2014 20:35:23 +0000 (UTC)
commit 1a7a2d91c1661218b67914ca5fa812b96f25081a
Author: Christian Hergert <christian hergert me>
Date: Thu Sep 18 13:35:18 2014 -0700
auto-indent: stub out format callback post-trigger.
src/editor/gb-source-auto-indenter-c.c | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/src/editor/gb-source-auto-indenter-c.c b/src/editor/gb-source-auto-indenter-c.c
index 0f0950d..081c81f 100644
--- a/src/editor/gb-source-auto-indenter-c.c
+++ b/src/editor/gb-source-auto-indenter-c.c
@@ -420,11 +420,13 @@ gb_source_auto_indenter_c_is_trigger (GbSourceAutoIndenter *indenter,
GdkEventKey *event)
{
switch (event->keyval) {
- case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
- case GDK_KEY_slash:
+ case GDK_KEY_Return:
case GDK_KEY_braceright:
+ case GDK_KEY_colon:
case GDK_KEY_numbersign:
+ case GDK_KEY_parenright:
+ case GDK_KEY_slash:
return TRUE;
default:
return FALSE;
@@ -460,6 +462,25 @@ gb_source_auto_indenter_c_format (GbSourceAutoIndenter *indenter,
g_debug ("TODO: unindent the curly brace if needed.");
break;
+ case GDK_KEY_colon:
+ /*
+ * If this is a label or a case, adjust indentation.
+ */
+ break;
+
+ case GDK_KEY_numbersign:
+ /*
+ * If this is a preprocessor directive, adjust indentation.
+ */
+ break;
+
+ case GDK_KEY_parenright:
+ /*
+ * If we are closing a function declaration, adjust the spacing of
+ * parameters so that *'s are aligned.
+ */
+ break;
+
case GDK_KEY_slash:
/*
* TODO:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]