highlightPrev method

ViewportModel highlightPrev()

Moves the viewport to the previous highlight.

Implementation

ViewportModel highlightPrev() {
  if (_highlights.isEmpty) return this;
  final prevIndex =
      (currentHighlightIndex - 1 + _highlights.length) % _highlights.length;
  return copyWith(currentHighlightIndex: prevIndex)._showHighlight();
}