IDEA-66623 The caret after introducing constant should remain on the usage, not on the constant declaration

This commit is contained in:
Maxim Medvedev
2011-03-17 17:29:56 +03:00
parent 2df6530e12
commit d5deb8a6e7
@@ -255,16 +255,11 @@ public abstract class GrIntroduceHandlerBase<Settings extends GrIntroduceSetting
CommandProcessor.getInstance().executeCommand(context.project, new Runnable() {
public void run() {
final GrVariable created = ApplicationManager.getApplication().runWriteAction(new Computable<GrVariable>() {
ApplicationManager.getApplication().runWriteAction(new Computable<GrVariable>() {
public GrVariable compute() {
return runRefactoring(context, settings);
}
});
if (editor != null && created != null) {
PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
editor.getCaretModel().moveToOffset(created.getNameIdentifierGroovy().getTextOffset());
}
}
}, getRefactoringName(), null);