Runnable (@NotNull ProgressIndicator indicator) { final Document document1 = getContent1().getDocument(); final Document document2 = getContent2().getDocument(); final CharSequence[] texts = ReadAction.compute( () -> new CharSequence[]{document1.getImmutableCharSequence(), document2.getImmutableCharSequence()}); final List<LineFragment> fragments = myTextDiffProvider.compare(texts[0], texts[1], indicator); UnifiedFragmentBuilder builder = ReadAction.compute(() -> { indicator.checkCanceled(); return new UnifiedFragmentBuilder(fragments, document1, document2, myMasterSide).exec(); }); return apply(builder, texts, indicator); }