From e7e215c31fd4e17df6921696d4fba5a5e3e03feb Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Wed, 27 Apr 2016 19:26:07 +0300 Subject: [PATCH] Don't invoke PythonEnterHandler.postProcessEnter() on non-Python files --- python/src/com/jetbrains/python/editor/PythonEnterHandler.java | 3 +++ 1 file changed, 3 insertions(+) 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;