DiffGutterOperation (@NotNull ThreeSide sourceSide, @NotNull ThreeSide modifiedSide) { EditorEx editor = myViewer.getEditor(sourceSide); int offset = DiffGutterOperation.lineToOffset(editor, getStartLine(sourceSide)); return new DiffGutterOperation.Simple(editor, offset, () -> { boolean isOtherEditable = myViewer.isEditable(modifiedSide); if (!isOtherEditable) return null; boolean isChanged = sourceSide != ThreeSide.BASE && isChange(sourceSide) || modifiedSide != ThreeSide.BASE && isChange(modifiedSide); if (!isChanged) return null; String text = getApplyActionText(myViewer, sourceSide, modifiedSide); Side arrowDirection = Side.fromLeft(sourceSide == ThreeSide.LEFT || modifiedSide == ThreeSide.RIGHT); Icon icon = DiffUtil.getArrowIcon(arrowDirection); return createIconRenderer(sourceSide, modifiedSide, text, icon, () -> myViewer.replaceChange(this, sourceSide, modifiedSide)); }); }