From e42e970f27a52d4a79529634b1827d26a176b86d Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Wed, 13 Jan 2016 14:01:06 +0300 Subject: [PATCH] search for error elements through all siblings #WEB-13313 fixed --- .../com/intellij/codeInsight/editorActions/EnterHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/EnterHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/EnterHandler.java index ad75a382871e..38d562937c61 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/EnterHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/EnterHandler.java @@ -278,8 +278,8 @@ public class EnterHandler extends BaseEnterHandler { */ private static boolean isInvalidPsi(@NotNull PsiElement base) { for (PsiElement current = base.getNextSibling(); current != null; current = current.getNextSibling()) { - if (current.getTextLength() != 0) { - return current instanceof PsiErrorElement; + if (current instanceof PsiErrorElement) { + return true; } } return false;