createAnchor method

CellAnchor createAnchor(
  1. int offset
)

Creates an anchor at cell offset of this line.

On a line read from a terminal (while attached), the anchor follows its cell as the terminal scrolls and reflows (libghostty-vt tracks it) until the cell leaves the scrollback; call CellAnchor.dispose when done. On any other line it is xterm's plain anchor.

Implementation

CellAnchor createAnchor(int offset) {
  final anchor =
      createTrackedAnchor(this, offset) ?? CellAnchor(offset, owner: this);
  _anchors.add(anchor);
  return anchor;
}