diff --git a/python/src/com/jetbrains/python/formatter/PyBlock.java b/python/src/com/jetbrains/python/formatter/PyBlock.java index 75fbdf35a4da..b9d47b37d3cf 100644 --- a/python/src/com/jetbrains/python/formatter/PyBlock.java +++ b/python/src/com/jetbrains/python/formatter/PyBlock.java @@ -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) { diff --git a/python/testData/formatter/continuationIndentInIndentingStatement.py b/python/testData/formatter/continuationIndentInIndentingStatement.py index 5822bc4971bb..ee0874e2bbce 100644 --- a/python/testData/formatter/continuationIndentInIndentingStatement.py +++ b/python/testData/formatter/continuationIndentInIndentingStatement.py @@ -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 diff --git a/python/testData/formatter/continuationIndentInIndentingStatement_after.py b/python/testData/formatter/continuationIndentInIndentingStatement_after.py index f38dd5199edd..26beec2a6b28 100644 --- a/python/testData/formatter/continuationIndentInIndentingStatement_after.py +++ b/python/testData/formatter/continuationIndentInIndentingStatement_after.py @@ -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