Search in sources :

Example 1 with Transformation

use of com.intellij.openapi.diff.impl.splitter.Transformation in project intellij-community by JetBrains.

the class DiffDividerDrawUtil method createVisibleSeparators.

@NotNull
public static List<DividerSeparator> createVisibleSeparators(@NotNull Editor editor1, @NotNull Editor editor2, @NotNull DividerSeparatorPaintable paintable) {
    final List<DividerSeparator> separators = new ArrayList<>();
    final Transformation[] transformations = new Transformation[] { getTransformation(editor1), getTransformation(editor2) };
    final LineRange leftInterval = getVisibleInterval(editor1);
    final LineRange rightInterval = getVisibleInterval(editor2);
    final int height1 = editor1.getLineHeight();
    final int height2 = editor2.getLineHeight();
    final EditorColorsScheme scheme = editor1.getColorsScheme();
    paintable.process((line1, line2) -> {
        if (leftInterval.start > line1 + 1 && rightInterval.start > line2 + 1)
            return true;
        if (leftInterval.end < line1 && rightInterval.end < line2)
            return false;
        separators.add(createSeparator(transformations, line1, line2, height1, height2, scheme));
        return true;
    });
    return separators;
}
Also used : Transformation(com.intellij.openapi.diff.impl.splitter.Transformation) ArrayList(java.util.ArrayList) EditorColorsScheme(com.intellij.openapi.editor.colors.EditorColorsScheme) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Transformation (com.intellij.openapi.diff.impl.splitter.Transformation)1 EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1