mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git.labs.intellij.net:idea/ultimate
This commit is contained in:
@@ -385,6 +385,9 @@ public class PyBlock implements ASTBlock {
|
||||
while (lastChild != null) {
|
||||
IElementType last_type = lastChild.getElementType();
|
||||
if ( last_type == PyElementTypes.STATEMENT_LIST && hasLineBreakBefore(lastChild)) {
|
||||
if (dedentAfterLastStatement((PyStatementList)lastChild.getPsi())) {
|
||||
break;
|
||||
}
|
||||
statementListsBelow++;
|
||||
}
|
||||
else if (statementListsBelow > 0 && lastChild.getPsi() instanceof PsiErrorElement) {
|
||||
|
||||
@@ -96,6 +96,10 @@ public class PyEditingTest extends PyLightFixtureTestCase {
|
||||
myFixture.checkResultByFile("/editing/uncommentWithSpace.after.py", true);
|
||||
}
|
||||
|
||||
public void testEnterInLineComment() { // PY-1739
|
||||
assertEquals("# foo\n# bar", doTestTyping("# foo bar", 5, '\n'));
|
||||
}
|
||||
|
||||
private String doTestTyping(final String text, final int offset, final char character) {
|
||||
final PsiFile file = ApplicationManager.getApplication().runWriteAction(new Computable<PsiFile>() {
|
||||
public PsiFile compute() {
|
||||
|
||||
@@ -167,6 +167,19 @@ public class PyIndentTest extends PyLightFixtureTestCase {
|
||||
" <caret>");
|
||||
}
|
||||
|
||||
public void testUnindentAfterReturnNotLast() { // PY-289
|
||||
doTest("def foo():\n" +
|
||||
" if True:\n" +
|
||||
" return<caret>\n" +
|
||||
"def bar(): pass",
|
||||
"def foo():\n" +
|
||||
" if True:\n" +
|
||||
" return\n" +
|
||||
" <caret>\n" +
|
||||
"def bar(): pass"
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: formatter core problem?
|
||||
public void testAlignListBeforeEquals() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user