if there happens to be a line break inside a qualified reference, make sure we add an indent (PY-6359)

This commit is contained in:
Dmitry Jemerov
2013-11-12 15:28:05 +01:00
parent 2d074933c3
commit 03fe0f49d1
4 changed files with 13 additions and 0 deletions
@@ -240,6 +240,11 @@ public class PyBlock implements ASTBlock {
childIndent = Indent.getNormalIndent();
}
}
else if (parentType == PyElementTypes.REFERENCE_EXPRESSION) {
if (child != _node.getFirstChildNode()) {
childIndent = Indent.getNormalIndent();
}
}
if (isAfterStatementList(child) && !hasLineBreaksBefore(child, 2) && child.getElementType() != PyTokenTypes.END_OF_LINE_COMMENT) {
// maybe enter was pressed and cut us from a previous (nested) statement list
+2
View File
@@ -0,0 +1,2 @@
sitesettings = call(settings_manager
.get_whitelabel_settings_by_site_id(myuser.site_id))
@@ -0,0 +1,2 @@
sitesettings = call(settings_manager
.get_whitelabel_settings_by_site_id(myuser.site_id))
@@ -354,6 +354,10 @@ public class PyFormatterTest extends PyTestCase {
doTest();
}
public void testWrapOnDot() { // PY-6359
doTest();
}
private void doTest() {
doTest(false);
}