From c6e258e35e5749755b17b0933dfc48ad82f33898 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 26 Apr 2012 13:09:46 +0200 Subject: [PATCH] inplace rename: restore caret position when rename to invalid (IDEA-85264) --- .../introduce/inplace/InplaceVariableIntroducer.java | 5 ----- .../refactoring/rename/inplace/InplaceRefactoring.java | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/InplaceVariableIntroducer.java b/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/InplaceVariableIntroducer.java index 1aec76c45211..f070a649e425 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/InplaceVariableIntroducer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/InplaceVariableIntroducer.java @@ -148,11 +148,6 @@ public abstract class InplaceVariableIntroducer extends In protected void collectAdditionalElementsToRename(List> stringUsages) { } - @Override - protected int restoreCaretOffset(int offset) { - return myCaretRangeMarker.isValid() ? myCaretRangeMarker.getStartOffset() : offset; - } - @Override protected String getCommandName() { return myTitle; diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java index cd1797075c0c..f29b13bdb06d 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/InplaceRefactoring.java @@ -354,7 +354,7 @@ public abstract class InplaceRefactoring { } protected int restoreCaretOffset(int offset) { - return offset; + return myCaretRangeMarker.isValid() ? myCaretRangeMarker.getStartOffset() : offset; } protected void navigateToAlreadyStarted(Document oldDocument, int exitCode) {