Help us shape the future of Go! Take the 2026 Go Developer Survey

help

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package help renders the keybinding overlay. The bindings are written out here by hand, so adding a key to the model means adding its row here too.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the overlay's state. The mode selects which mode-specific bindings are listed and must match the mode strings the parent passes to Show.

func New

func New() Model

New returns a hidden overlay.

func (*Model) Hide

func (m *Model) Hide()

Hide closes the overlay.

func (*Model) IsVisible

func (m *Model) IsVisible() bool

IsVisible reports whether the overlay is open, which is how the parent decides to route keys here.

func (*Model) ScrollBy added in v0.2.4

func (m *Model) ScrollBy(delta int)

ScrollBy moves the overlay's viewport by delta rows. View clamps the result against the content it actually has, so callers may pass any delta.

func (*Model) ScrollToEnd added in v0.2.4

func (m *Model) ScrollToEnd()

ScrollToEnd jumps to the last row of the overlay.

func (*Model) ScrollToStart added in v0.2.4

func (m *Model) ScrollToStart()

ScrollToStart jumps to the first row of the overlay.

func (*Model) Show

func (m *Model) Show(mode string)

Show opens the overlay for a mode, where "Diff-Editor" and "Interactive" each add their own bindings and any other value lists only the shared ones.

func (*Model) View

func (m *Model) View(width, height int) string

View renders the overlay centered in the given terminal size, returning the empty string while hidden. Content taller than the terminal scrolls, and the footer says so, so a short terminal never hides bindings without admitting it. It clamps the scroll offset as a side effect.

Jump to

Keyboard shortcuts

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