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

hints

package
v0.233.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

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