mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-15564 Remove text after the first backslash inside whitespace during line joining
This commit is contained in:
@@ -119,6 +119,12 @@ public class PyJoinLinesHandler implements JoinRawLinesHandlerDelegate {
|
||||
}
|
||||
}
|
||||
}
|
||||
final String sequence = text.subSequence(i + 1, end).toString();
|
||||
final int index = sequence.indexOf('\\');
|
||||
if (index >= 0) {
|
||||
document.replaceString(i + 1, end, sequence.substring(0, index));
|
||||
return i + 1 + index;
|
||||
}
|
||||
return CANNOT_JOIN;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from foo import bar, baz
|
||||
@@ -0,0 +1,2 @@
|
||||
from foo import bar, \
|
||||
baz
|
||||
@@ -0,0 +1 @@
|
||||
import foo, bar
|
||||
@@ -0,0 +1,2 @@
|
||||
import foo, \
|
||||
bar
|
||||
@@ -138,4 +138,14 @@ public class PyJoinLinesTest extends PyTestCase {
|
||||
public void testListComprehension() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-15564
|
||||
public void testBackslashBetweenTargetsInImport() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-15564
|
||||
public void testBackslashBetweenTargetsInFromImport() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user