void () { if (myViewer.isStateIsOutOfDate()) return; if (!myViewer.isEditable(sourceSide.other(), true)) return; final Project project = myViewer.getProject(); final Document document = myViewer.getDocument(sourceSide.other()); DiffUtil.executeWriteCommand(document, project, DiffBundle.message("message.replace.change.command"), () -> { myViewer.replaceChange(myChange, sourceSide); myViewer.scheduleRediff(); }); // applyChange() will schedule rediff, but we want to try to do it in sync // and we can't do it inside write action myViewer.rediff(); }