Search in sources :

Example 1 with FragmentHighlighterImpl

use of com.intellij.openapi.diff.impl.fragments.FragmentHighlighterImpl in project intellij-community by JetBrains.

the class SimpleDiffPanelState method addMarkup.

private LineBlocks addMarkup(final List<LineFragment> lines) {
    ApplicationManager.getApplication().runWriteAction(() -> {
        final FragmentHighlighterImpl fragmentHighlighter = new FragmentHighlighterImpl(myAppender1, myAppender2);
        for (Iterator<LineFragment> iterator = lines.iterator(); iterator.hasNext(); ) {
            LineFragment line = iterator.next();
            fragmentHighlighter.setIsLast(!iterator.hasNext());
            line.highlight(fragmentHighlighter);
        }
    });
    ArrayList<LineFragment> allLineFragments = new ArrayList<>();
    for (LineFragment lineFragment : lines) {
        allLineFragments.add(lineFragment);
        lineFragment.addAllDescendantsTo(allLineFragments);
    }
    myFragmentList = FragmentListImpl.fromList(allLineFragments);
    return LineBlocks.fromLineFragments(allLineFragments);
}
Also used : LineFragment(com.intellij.openapi.diff.impl.fragments.LineFragment) FragmentHighlighterImpl(com.intellij.openapi.diff.impl.fragments.FragmentHighlighterImpl) ArrayList(java.util.ArrayList)

Aggregations

FragmentHighlighterImpl (com.intellij.openapi.diff.impl.fragments.FragmentHighlighterImpl)1 LineFragment (com.intellij.openapi.diff.impl.fragments.LineFragment)1 ArrayList (java.util.ArrayList)1