void (@NotNull MergeResult result) { final CharSequence applyContent; switch (result) { case CANCEL -> applyContent = MergeUtil.shouldRestoreOriginalContentOnCancel(this) ? myOriginalContent : null; case LEFT -> { CharSequence leftContent = ThreeSide.LEFT.select(getContents()).getDocument().getImmutableCharSequence(); applyContent = StringUtil.convertLineSeparators(leftContent.toString()); } case RIGHT -> { CharSequence rightContent = ThreeSide.RIGHT.select(getContents()).getDocument().getImmutableCharSequence(); applyContent = StringUtil.convertLineSeparators(rightContent.toString()); } case RESOLVED -> applyContent = null; default -> throw new IllegalArgumentException(result.toString()); } if (applyContent != null) { DiffUtil.executeWriteCommand(myOutput.getDocument(), myProject, null, () -> myOutput.getDocument().setText(applyContent)); } MergeCallback.getCallback(this).applyResult(result); }