[gnome-builder] python: its for .. else, not while .. else.



commit 6722eb7fa6ccffb9d86be521f8266cb680781a21
Author: Christian Hergert <christian hergert me>
Date:   Sun Jan 11 03:50:59 2015 -0800

    python: its for .. else, not while .. else.

 src/auto-indent/gb-source-auto-indenter-python.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/auto-indent/gb-source-auto-indenter-python.c 
b/src/auto-indent/gb-source-auto-indenter-python.c
index 29fb196..6c77970 100644
--- a/src/auto-indent/gb-source-auto-indenter-python.c
+++ b/src/auto-indent/gb-source-auto-indenter-python.c
@@ -554,9 +554,9 @@ maybe_unindent_else_or_elif (GbSourceAutoIndenterPython *python,
     {
       /*
        * TODO: This doesn't handle unindent properly for multi line
-       *       if or while statements.
+       *       if or for blocks.
        */
-      while (!(line_starts_with (&copy, "if ") || line_starts_with (&copy, "while ")) ||
+      while (!(line_starts_with (&copy, "if ") || line_starts_with (&copy, "for ")) ||
              !line_ends_with (&copy, ":"))
         {
           guint if_line;
@@ -573,7 +573,7 @@ maybe_unindent_else_or_elif (GbSourceAutoIndenterPython *python,
               break;
         }
 
-      if ((line_starts_with (&copy, "if ") || line_starts_with (&copy, "while ")) &&
+      if ((line_starts_with (&copy, "if ") || line_starts_with (&copy, "for ")) &&
           line_ends_with (&copy, ":"))
         {
           gtk_text_iter_set_line_offset (begin,


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