[gnome-builder/wip/commands2] auto-indent: only format params if more than 1



commit a32d230aa63c40dc838b9543ab63ed9b576c9c82
Author: Christian Hergert <christian hergert me>
Date:   Thu Oct 9 15:42:23 2014 -0700

    auto-indent: only format params if more than 1
    
    No sense in formatting parmameters that are just a single item.
    Easier to just leave it be since they will never match up with the
    surrounding functions in a header anyway.

 src/editor/gb-source-auto-indenter-c.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/editor/gb-source-auto-indenter-c.c b/src/editor/gb-source-auto-indenter-c.c
index ef18763..a7aadb5 100644
--- a/src/editor/gb-source-auto-indenter-c.c
+++ b/src/editor/gb-source-auto-indenter-c.c
@@ -939,7 +939,8 @@ maybe_align_parameters (GbSourceAutoIndenterC *c,
       gtk_text_iter_backward_char (end) &&
       (gtk_text_iter_compare (begin, end) < 0) &&
       (text = gtk_text_iter_get_slice (begin, end)) &&
-      (params = parse_parameters (text)))
+      (params = parse_parameters (text)) &&
+      (params->next != NULL))
     ret = format_parameters (begin, params);
 
   g_slist_foreach (params, (GFunc)parameter_free, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]