mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
GroovyEnterHandler shouldn't work for non-groovy files
This commit is contained in:
+5
@@ -44,6 +44,7 @@ import org.jetbrains.plugins.groovy.formatter.GeeseUtil;
|
||||
import org.jetbrains.plugins.groovy.formatter.GroovyCodeStyleSettings;
|
||||
import org.jetbrains.plugins.groovy.lang.editor.HandlerUtils;
|
||||
import org.jetbrains.plugins.groovy.lang.lexer.GroovyLexer;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrClosableBlock;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
|
||||
@@ -119,6 +120,10 @@ public class GroovyEnterHandler extends EnterHandlerDelegateAdapter {
|
||||
return Result.Continue;
|
||||
}
|
||||
|
||||
if (!(file instanceof GroovyFileBase)) {
|
||||
return Result.Continue;
|
||||
}
|
||||
|
||||
final int caret = editor.getCaretModel().getOffset();
|
||||
final EditorHighlighter highlighter = ((EditorEx)editor).getHighlighter();
|
||||
if (caret >= 1 && caret < text.length() && CodeInsightSettings.getInstance().SMART_INDENT_ON_ENTER) {
|
||||
|
||||
Reference in New Issue
Block a user