holds method

bool holds(
  1. int line
)

Whether line (1-based) is the page's heading or one of its own lines.

Implementation

bool holds(int line) => line == heading || (line >= from && line <= to);