void (@NotNull TextMergeChange change, @NotNull ThreeSide side) { if (!canResolveChangeAutomatically(change, side)) return; if (change.isConflict()) { List<CharSequence> texts = ThreeSide.map(it -> DiffUtil.getLinesContent(getEditor(it).getDocument(), change.getStartLine(it), change.getEndLine(it))); CharSequence newContent = ComparisonMergeUtil.tryResolveConflict(texts.get(0), texts.get(1), texts.get(2)); if (newContent == null) { LOG.warn(String.format("Can't resolve conflicting change:\n'%s'\n'%s'\n'%s'\n", texts.get(0), texts.get(1), texts.get(2))); return; } String[] newContentLines = LineTokenizer.tokenize(newContent, false); myModel.replaceChange(change.getIndex(), Arrays.asList(newContentLines)); markChangeResolved(change); } else { Side masterSide = side.select(Side.LEFT, change.isChange(Side.LEFT) ? Side.LEFT : Side.RIGHT, Side.RIGHT); replaceChange(change, masterSide, false); } }