From 7ff1765627fca6891cfe1afb6e87eaa0638a1711 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Mon, 3 Nov 2014 17:55:07 +0100 Subject: [PATCH] surround with runnable: do not move caret if inplace rename was started but popup with code/all occurrences suggestions was shown (IDEA-132277) --- .../generation/surroundWith/SurroundWithHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/SurroundWithHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/SurroundWithHandler.java index 1fd552db96d2..d8fcf2bd2c49 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/SurroundWithHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/SurroundWithHandler.java @@ -51,6 +51,7 @@ import com.intellij.psi.PsiCompiledElement; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; +import com.intellij.refactoring.rename.inplace.InplaceRefactoring; import com.intellij.util.IncorrectOperationException; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.UIUtil; @@ -198,7 +199,7 @@ public class SurroundWithHandler implements CodeInsightActionHandler { editor.getCaretModel().moveToLogicalPosition(pos); } TextRange range = surrounder.surroundElements(project, editor, elements); - if (TemplateManager.getInstance(project).getActiveTemplate(editor) == null) { + if (TemplateManager.getInstance(project).getActiveTemplate(editor) == null && InplaceRefactoring.getActiveInplaceRenamer(editor) == null) { LogicalPosition pos1 = new LogicalPosition(line, col); editor.getCaretModel().moveToLogicalPosition(pos1); }