hints

package
v0.136.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

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

Formatter provides methods to format keybinding hints for UI display

func NewFormatter

func NewFormatter(registry KeyRegistry) *Formatter

NewFormatter creates a new key hint formatter with a registry

func (*Formatter) GetKeyHint

func (f *Formatter) GetKeyHint(actionID string, actionVerb string) string

GetKeyHint returns a formatted hint string for a given action ID Format: "Press <key> to <action>" Example: "Press ctrl+o to expand" or "Press esc to cancel"

func (*Formatter) GetKeyOnly

func (f *Formatter) GetKeyOnly(actionID string) string

GetKeyOnly returns just the key binding without "Press" or action verb Useful for inline hints like "ctrl+o"

type KeyAction

type KeyAction interface {
	GetKeys() []string
	IsEnabled() bool
}

KeyAction represents a minimal key action interface for hint formatting

type KeyRegistry

type KeyRegistry interface {
	GetAction(id string) KeyAction
}

KeyRegistry provides access to registered key actions

Jump to

Keyboard shortcuts

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