diff --git a/python/src/com/jetbrains/python/editor/PythonEnterHandler.java b/python/src/com/jetbrains/python/editor/PythonEnterHandler.java index 0656177f2fe9..a5ac25ad568b 100644 --- a/python/src/com/jetbrains/python/editor/PythonEnterHandler.java +++ b/python/src/com/jetbrains/python/editor/PythonEnterHandler.java @@ -358,6 +358,9 @@ public class PythonEnterHandler extends EnterHandlerDelegateAdapter { public Result postProcessEnter(@NotNull PsiFile file, @NotNull Editor editor, @NotNull DataContext dataContext) { + if (!(file instanceof PyFile)) { + return Result.Continue; + } if (myPostprocessShift > 0) { editor.getCaretModel().moveCaretRelatively(myPostprocessShift, 0, false, false, false); myPostprocessShift = 0;