Search in sources :

Example 1 with LineCol

use of com.intellij.diff.util.LineCol in project intellij-community by JetBrains.

the class TwosideTextDiffViewer method getNavigatable.

//
// Misc
//
@Nullable
@Override
protected Navigatable getNavigatable() {
    Side side = getCurrentSide();
    LineCol position = LineCol.fromCaret(getEditor(side));
    Navigatable navigatable = getContent(side).getNavigatable(position);
    if (navigatable != null)
        return navigatable;
    LineCol otherPosition = transferPosition(side, position);
    return getContent(side.other()).getNavigatable(otherPosition);
}
Also used : Side(com.intellij.diff.util.Side) LineCol(com.intellij.diff.util.LineCol) Navigatable(com.intellij.pom.Navigatable) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with LineCol

use of com.intellij.diff.util.LineCol in project intellij-community by JetBrains.

the class DocumentFragmentContent method getNavigatable.

@Nullable
@Override
public Navigatable getNavigatable(@NotNull LineCol position) {
    if (!myRangeMarker.isValid())
        return null;
    int offset = position.toOffset(getDocument());
    int originalOffset = offset + myRangeMarker.getStartOffset();
    LineCol originalPosition = LineCol.fromOffset(myOriginal.getDocument(), originalOffset);
    return myOriginal.getNavigatable(originalPosition);
}
Also used : LineCol(com.intellij.diff.util.LineCol) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

LineCol (com.intellij.diff.util.LineCol)2 Nullable (org.jetbrains.annotations.Nullable)2 Side (com.intellij.diff.util.Side)1 Navigatable (com.intellij.pom.Navigatable)1