PY-23578 Properly collapse whitespaces surrounding deleted PSI range in CodeEditUtil

This commit is contained in:
Mikhail Golubev
2017-10-09 12:56:15 +03:00
parent baa7943629
commit f2cb78e602
@@ -142,7 +142,7 @@ public class CodeEditUtil {
assert child == last : last + " is not a successor of " + first + " in the .getTreeNext() chain";
final ASTNode prevLeaf = TreeUtil.prevLeaf(first);
final ASTNode nextLeaf = TreeUtil.nextLeaf(first);
final ASTNode nextLeaf = TreeUtil.nextLeaf(last);
parent.removeRange(first, last.getTreeNext());
ASTNode nextLeafToAdjust = nextLeaf;
if (nextLeafToAdjust != null && prevLeaf != null && nextLeafToAdjust.getTreeParent() == null) {