help

package
v0.36.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package help is the keymap overlay: a scrollable modal listing every binding, grouped by the context it applies in.

It follows the same contract as the panels — a concrete type the root model owns and drives, never a tea.Model. An overlay that took the root model as a parameter would only be handing it straight back, and deciding app policy (quitting) on its behalf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Overlay

type Overlay struct {
	// contains filtered or unexported fields
}

Overlay is the keymap modal.

The zero value is a closed overlay; the root model opens it and composites its View over the base UI.

func New

func New() Overlay

New builds a closed keymap overlay.

func (*Overlay) Close

func (o *Overlay) Close()

Close hides the overlay.

func (*Overlay) HandleKey

func (o *Overlay) HandleKey(msg tea.KeyMsg) tea.Cmd

HandleKey drives the overlay: scroll, or dismiss.

It swallows everything else — the overlay covers the UI, so acting on a key the user cannot see the effect of would be worse than ignoring it. Quitting is the one exception, and it belongs to the root model, which checks for it before the overlay ever sees the key.

func (*Overlay) IsOpen

func (o *Overlay) IsOpen() bool

IsOpen reports whether the overlay is currently covering the UI.

func (*Overlay) Open

func (o *Overlay) Open()

Open shows the keymap overlay, always from the top: it is opened to look something up, not resumed.

func (*Overlay) SetSize

func (o *Overlay) SetSize(w, h int)

SetSize fits the overlay to outer dimensions w×h (border + title reserved).

func (*Overlay) View

func (o *Overlay) View() string

View renders the help modal, with scrolling.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL