diff --git a/python/src/META-INF/python-plugin-common.xml b/python/src/META-INF/python-plugin-common.xml
index 322c139b6009..74a122710edd 100644
--- a/python/src/META-INF/python-plugin-common.xml
+++ b/python/src/META-INF/python-plugin-common.xml
@@ -176,6 +176,7 @@
serviceImplementation="com.jetbrains.python.psi.resolve.PythonPathCache"/>
+
diff --git a/python/src/com/jetbrains/python/formatter/PyBlock.java b/python/src/com/jetbrains/python/formatter/PyBlock.java
index 5b850e222f10..a0e82a143d27 100644
--- a/python/src/com/jetbrains/python/formatter/PyBlock.java
+++ b/python/src/com/jetbrains/python/formatter/PyBlock.java
@@ -98,9 +98,11 @@ public class PyBlock implements ASTBlock {
// whitespace between sub-blocks would include \ characters,
// because the IDEA 5.0/5.1 formatter core requires that whitespace
// between blocks must include whitespace-only characters
+ /*
if (child.getText().indexOf('\\') >= 0) {
return Collections.emptyList();
}
+ */
continue;
}
diff --git a/python/src/com/jetbrains/python/formatter/PyWhiteSpaceFormattingStrategy.java b/python/src/com/jetbrains/python/formatter/PyWhiteSpaceFormattingStrategy.java
new file mode 100644
index 000000000000..ca1913c6f849
--- /dev/null
+++ b/python/src/com/jetbrains/python/formatter/PyWhiteSpaceFormattingStrategy.java
@@ -0,0 +1,20 @@
+package com.jetbrains.python.formatter;
+
+import com.intellij.formatting.WhiteSpaceFormattingStrategy;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author yole
+ */
+public class PyWhiteSpaceFormattingStrategy implements WhiteSpaceFormattingStrategy {
+ @Override
+ public int check(@NotNull CharSequence text, int start, int end) {
+ for (int i = start; i < end; i++) {
+ char c = text.charAt(i);
+ if (c != ' ' && c != '\t' && c != '\n' && c != '\\') {
+ return i;
+ }
+ }
+ return end;
+ }
+}
diff --git a/python/testData/formatter/spaceAfterCommaWrappedLine.py b/python/testData/formatter/spaceAfterCommaWrappedLine.py
new file mode 100644
index 000000000000..fa5eee9b5f39
--- /dev/null
+++ b/python/testData/formatter/spaceAfterCommaWrappedLine.py
@@ -0,0 +1,2 @@
+import contextlib,\
+ math,decimal
diff --git a/python/testData/formatter/spaceAfterCommaWrappedLine_after.py b/python/testData/formatter/spaceAfterCommaWrappedLine_after.py
new file mode 100644
index 000000000000..5b1c4b0e5866
--- /dev/null
+++ b/python/testData/formatter/spaceAfterCommaWrappedLine_after.py
@@ -0,0 +1,2 @@
+import contextlib,\
+ math, decimal
diff --git a/python/testSrc/com/jetbrains/python/PyFormatterTest.java b/python/testSrc/com/jetbrains/python/PyFormatterTest.java
index ae77184d39c4..29d1986ffe81 100644
--- a/python/testSrc/com/jetbrains/python/PyFormatterTest.java
+++ b/python/testSrc/com/jetbrains/python/PyFormatterTest.java
@@ -72,6 +72,10 @@ public class PyFormatterTest extends PyLightFixtureTestCase {
doTest();
}
+ public void _testSpaceAfterCommaWrappedLine() { // PY-1065
+ doTest();
+ }
+
private void doTest() {
myFixture.configureByFile("formatter/" + getTestName(true) + ".py");
ApplicationManager.getApplication().runWriteAction(new Runnable() {