Table of Contents

Method ScrollToAnchor

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

ScrollToAnchor(string)

Scrolls the viewport so that the heading matching the given anchor slug is visible at the top.

public bool ScrollToAnchor(string anchor)

Parameters

anchor string

The anchor identifier (with or without a leading #). Anchors are generated from heading text using GitHub-style slug rules: lowercase, spaces become hyphens, non-alphanumeric characters are removed, and duplicate headings receive -1, -2, etc. suffixes.

Returns

bool

true if a matching heading was found and the viewport was scrolled; otherwise false.