mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
restore caret in variable if exist (IDEA-69663; IDEA-69661)
This commit is contained in:
+4
@@ -486,6 +486,10 @@ public class InplaceIntroduceConstantPopup {
|
||||
ApplicationManager.getApplication().runWriteAction(runnable);
|
||||
}
|
||||
super.moveOffsetAfter(success);
|
||||
if (myLocalVariable != null && myLocalVariable.isValid()) {
|
||||
myEditor.getCaretModel().moveToOffset(myLocalVariable.getTextOffset());
|
||||
myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
|
||||
}
|
||||
if (myMoveToAnotherClassCb.isSelected()) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
|
||||
+4
@@ -385,6 +385,10 @@ public class InplaceIntroduceFieldPopup {
|
||||
ApplicationManager.getApplication().runWriteAction(runnable);
|
||||
}
|
||||
super.moveOffsetAfter(success);
|
||||
if (myLocalVariable != null && myLocalVariable.isValid()) {
|
||||
myEditor.getCaretModel().moveToOffset(myLocalVariable.getTextOffset());
|
||||
myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
@@ -368,6 +368,10 @@ class InplaceIntroduceParameterPopup extends IntroduceParameterSettingsUI {
|
||||
CommandProcessor.getInstance().executeCommand(myProject, runnable, IntroduceParameterHandler.REFACTORING_NAME, null);
|
||||
}
|
||||
super.moveOffsetAfter(false);
|
||||
if (myLocalVar != null && myLocalVar.isValid()) {
|
||||
myEditor.getCaretModel().moveToOffset(myLocalVar.getTextOffset());
|
||||
myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user