void (final String presentPrefix, final String newPrefix) { if (!performGuardedChange(() -> { EditorModificationUtilEx.deleteSelectedText(myEditor); int offset = myEditor.getCaretModel().getOffset(); final int start = offset - presentPrefix.length(); myEditor.getDocument().replaceString(start, offset, newPrefix); myOffsets.clearAdditionalPrefix(); myEditor.getCaretModel().moveToOffset(start + newPrefix.length()); })) { return; } myPresentableArranger.prefixReplaced(this, newPrefix); refreshUi(true, true); }