Skip to content

Commit 5535bda

Browse files
committed
bug fix: repeat .. until
1 parent 7d813ff commit 5535bda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/tang/intellij/lua/codeInsight/LuaEnterAfterUnmatchedBraceHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.tang.intellij.lua.codeInsight;
1818

1919
import com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegate;
20+
import com.intellij.lang.ASTNode;
2021
import com.intellij.openapi.actionSystem.DataContext;
2122
import com.intellij.openapi.application.ApplicationManager;
2223
import com.intellij.openapi.editor.Document;
@@ -69,8 +70,8 @@ public Result preprocessEnter(@NotNull PsiFile psiFile,
6970
if (searched == null || searched instanceof PsiFile) break;
7071
if (searched instanceof LuaIndentRange) {
7172
IElementType endType = getEnd(searched.getNode().getElementType());
72-
PsiElement lastChild = searched.getLastChild();
73-
if (lastChild.getNode().getElementType() != endType) {
73+
ASTNode endChild = searched.getNode().findChildByType(endType);
74+
if (endChild == null) {
7475
needAddEnd = true;
7576
range = searched;
7677
break;

0 commit comments

Comments
 (0)