Documentation
¶
Overview ¶
Package help provides a dumb, reusable, lazygit-style help overlay: a centered, capped-size box listing key-binding sections. It holds no application state and knows nothing about actual keybindings beyond what SetSections is given — callers own deciding what to show, when to show it, and closing it (this component never consumes esc/? itself).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binding ¶
Binding is a single key-binding entry: the key(s) that trigger it and a short description of what they do.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the help overlay component.
func (*Model) SetFooter ¶
SetFooter overrides the footer hint line (default: "↑↓/jk: scroll · Esc/?: close"). Pass "" to fall back to the default. Exists because the actual keys that scroll/close the overlay are decided by the caller (e.g. a configurable/rebound keys.help), not by this component — a hardcoded footer here would silently drift out of sync with whatever the caller actually binds.
func (*Model) SetSections ¶
SetSections replaces the sections shown, in the order given. Resets scroll to the top, since a previous scroll offset is unlikely to still make sense against different content.
func (*Model) SetVisible ¶
SetVisible shows or hides the overlay. Resets scroll to the top on show, so re-opening the overlay always starts from the beginning.
func (Model) Update ¶
Update handles j/k/up/down/pgup/pgdown/g/G scroll keys while the overlay is visible.
This is NOT part of help's required contract (New/SetSections/ SetVisible/IsVisible/SetSize/View): a caller that never invokes it still gets a fully working, correctly rendered overlay — it just can't scroll content that overflows the box height. A caller that wants scroll support should route key events here while IsVisible() is true; esc/? must stay handled by the caller outside Update (this component never closes itself), typically by checking those keys before ever reaching this method.