ASTNode (ASTNode first, ASTNode last, ASTNode anchor, Boolean before) { if (first.getPsi() instanceof PyStatement && getStatements().length == 1) { ASTNode treePrev = getNode().getTreePrev(); if (treePrev != null && treePrev.getElementType() == TokenType.WHITE_SPACE && !treePrev.textContains('\n')) { ASTNode lineBreak = ASTFactory.whitespace("\n"); treePrev.getTreeParent().replaceChild(treePrev, lineBreak); } } return super.addInternal(first, last, anchor, before); }