Runnable (@NotNull ProgressIndicator indicator) { try { indicator.checkCanceled(); IgnorePolicy ignorePolicy = myTextDiffProvider.getIgnorePolicy(); List<DocumentContent> contents = myMergeRequest.getContents(); List<CharSequence> sequences = ReadAction.compute(() -> { indicator.checkCanceled(); return ContainerUtil.map(contents, content -> content.getDocument().getImmutableCharSequence()); }); List<LineOffsets> lineOffsets = ContainerUtil.map(sequences, LineOffsetsUtil::create); ComparisonManager manager = ComparisonManager.getInstance(); List<MergeLineFragment> lineFragments = manager.mergeLines(sequences.get(0), sequences.get(1), sequences.get(2), ignorePolicy.getComparisonPolicy(), indicator); List<MergeConflictType> conflictTypes = ContainerUtil.map(lineFragments, fragment -> MergeRangeUtil.getLineMergeType(fragment, sequences, lineOffsets, ignorePolicy.getComparisonPolicy())); FoldingModelSupport.Data foldingState = myFoldingModel.createState(lineFragments, lineOffsets, getFoldingModelSettings()); return () -> apply(lineFragments, conflictTypes, foldingState, ignorePolicy); } catch (DiffTooBigException e) { return applyNotification(DiffNotifications.createDiffTooBig()); } catch (ProcessCanceledException e) { throw e; } catch (Throwable e) { LOG.error(e); return () -> { clearDiffPresentation(); myPanel.setErrorContent(); }; } }