From 908fb3cfcd2006cc60a34313b98f0103b725cf64 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Fri, 23 Sep 2016 19:34:40 +0300 Subject: [PATCH] IDEA-161581 "Create local variable" makes the screen jumps --- .../daemon/impl/quickfix/CreateFromUsageBaseFix.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java index 800506886c39..5d9304895ed7 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageBaseFix.java @@ -27,6 +27,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.editor.ScrollType; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.OpenFileDescriptor; import com.intellij.openapi.fileEditor.ex.IdeDocumentHistory; @@ -155,6 +156,7 @@ public abstract class CreateFromUsageBaseFix extends BaseIntentionAction { if (file == null) return null; } OpenFileDescriptor descriptor = new OpenFileDescriptor(project, file, textOffset); + descriptor.setScrollType(ScrollType.MAKE_VISIBLE); // avoid centering caret in editor if it's already visible return FileEditorManager.getInstance(project).openTextEditor(descriptor, true); }