void (UsageInfo @NotNull [] usages) { RangeMarker position = null; if (myEditor != null) { final int offset = myEditor.getCaretModel().getOffset(); position = myEditor.getDocument().createRangeMarker(offset, offset + 1); } LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName()); try { doRefactoring(usages); } finally { a.finish(); } if (position != null) { if (position.isValid()) { myEditor.getCaretModel().moveToOffset(position.getStartOffset()); } position.dispose(); } }