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

help

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 3 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) 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. The content is clipped rather than scrolled when it is taller than height.

Jump to

Keyboard shortcuts

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