Fix continuation indentation in while statement (PY-11869).
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Thu, 23 Jan 2014 13:29:02 +0000 (14:29 +0100)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Thu, 23 Jan 2014 13:29:02 +0000 (14:29 +0100)
python/src/com/jetbrains/python/formatter/PyBlock.java
python/testData/formatter/continuationIndentInIndentingStatement.py
python/testData/formatter/continuationIndentInIndentingStatement_after.py

index 75fbdf35a4da591d23df642748a0540709131d6a..b9d47b37d3cfea90884ee14146432201302b992b 100644 (file)
@@ -284,7 +284,8 @@ public class PyBlock implements ASTBlock {
            psi instanceof PyFunction ||
            psi instanceof PyTryExceptStatement ||
            psi instanceof PyElsePart ||
-           psi instanceof PyIfPart;
+           psi instanceof PyIfPart ||
+           psi instanceof PyWhileStatement;
   }
 
   private static boolean isSubscriptionOperand(ASTNode child) {
index 5822bc4971bb551a82563ce039fcdc0fff69471b..ee0874e2bbce4c83ddc117aa045005f49539d5c2 100644 (file)
@@ -28,4 +28,8 @@ try:
     pass
 except \
     AttributeError:
-    pass
\ No newline at end of file
+    pass
+
+while value \
+    in values:  # <- missing continuation indent here
+    do_smth()
\ No newline at end of file
index f38dd5199edd4cfcd523652454eb76b4acbe6a13..26beec2a6b2826f8f13991ce48e6d45142c59552 100644 (file)
@@ -28,4 +28,8 @@ try:
     pass
 except \
         AttributeError:
-    pass
\ No newline at end of file
+    pass
+
+while value \
+        in values:  # <- missing continuation indent here
+    do_smth()
\ No newline at end of file