diff --git a/python/src/com/jetbrains/python/formatter/PyBlock.java b/python/src/com/jetbrains/python/formatter/PyBlock.java index a195013a2aa2..5fdecfbfbe2b 100644 --- a/python/src/com/jetbrains/python/formatter/PyBlock.java +++ b/python/src/com/jetbrains/python/formatter/PyBlock.java @@ -171,7 +171,7 @@ public class PyBlock implements ASTBlock { else { childIndent = parentType == PyElementTypes.PARAMETER_LIST || isInControlStatement() ? Indent.getContinuationIndent() - : Indent.getNormalIndent(); + : Indent.getNormalIndent(true); } } else if (parentType == PyElementTypes.DICT_LITERAL_EXPRESSION || parentType == PyElementTypes.SET_LITERAL_EXPRESSION || diff --git a/python/testData/formatter/indentInNestedCall.py b/python/testData/formatter/indentInNestedCall.py new file mode 100644 index 000000000000..ba5782ddc0cd --- /dev/null +++ b/python/testData/formatter/indentInNestedCall.py @@ -0,0 +1,4 @@ +logging.warn('some_very_{long}_' + 'amount_of_{text}'.format( + long='long', + text='text')) \ No newline at end of file diff --git a/python/testData/formatter/indentInNestedCall_after.py b/python/testData/formatter/indentInNestedCall_after.py new file mode 100644 index 000000000000..58c0c164122c --- /dev/null +++ b/python/testData/formatter/indentInNestedCall_after.py @@ -0,0 +1,4 @@ +logging.warn('some_very_{long}_' + 'amount_of_{text}'.format( + long='long', + text='text')) \ No newline at end of file diff --git a/python/testSrc/com/jetbrains/python/PyFormatterTest.java b/python/testSrc/com/jetbrains/python/PyFormatterTest.java index 3a843a51a3df..e97fe1a76ea5 100644 --- a/python/testSrc/com/jetbrains/python/PyFormatterTest.java +++ b/python/testSrc/com/jetbrains/python/PyFormatterTest.java @@ -268,6 +268,10 @@ public class PyFormatterTest extends PyTestCase { doTest(); } + public void testIndentInNestedCall() { // PY-8195 + doTest(); + } + public void testIndentAfterBackslash() { doTest(); }