navigation method

Source-order navigation, with one stop per parsed code line.

Context uses side; additions and deletions use their available side. This order does not change with wrapping or presentation mode.

Implementation

List<DiffCommentLineKey> navigation(DiffCommentSide side) =>
    _navigation.putIfAbsent(
      side,
      () => List.unmodifiable({
        for (final row in _rows)
          if (side == DiffCommentSide.left)
            row.left ?? row.right!
          else
            row.right ?? row.left!,
      }),
    );