Documentation
¶
Index ¶
- Constants
- Variables
- type CommandHelp
- type CommandInfo
- type HelpCategory
- type HelpItem
- type Model
- func (m *Model) ApplySearchQuery(query string)
- func (m *Model) ClearSearchQuery()
- func (m *Model) FrameContent() string
- func (m *Model) FrameFooter() string
- func (m *Model) FrameHeader() string
- func (m *Model) FrameTitle() string
- func (m *Model) HasErrors() bool
- func (m *Model) Init() tea.Cmd
- func (m *Model) Name() string
- func (m *Model) OnEnter() tea.Cmd
- func (m *Model) OnExit() tea.Cmd
- func (m *Model) ShortHelpItems() []helpbar.HelpEntry
- func (m *Model) Update(msg tea.Msg) tea.Cmd
- func (m *Model) View() string
Constants ¶
const ViewName = "help"
Variables ¶
var SupportContact string
SupportContact, when non-empty, is rendered as a SUPPORT line at the bottom of the keybinding cheat-sheet. Empty by default so OSS shows nothing; editions set it to their support address at startup.
Functions ¶
This section is empty.
Types ¶
type CommandHelp ¶
type CommandHelp struct {
Title string
Detail string // optional prose rendered under the USAGE section
Sections []HelpCategory
}
CommandHelp is the payload for the per-command `--help` / `:help <cmd>` screen. It is a distinct type (not []HelpCategory) so the view factory routes it to the vertical layout and the keybinding cheat-sheet path is left untouched.
type CommandInfo ¶
type HelpCategory ¶
func FromKeys ¶ added in v1.14.0
func FromKeys(title string, viewKeys, globalKeys []helpbar.HelpEntry) []HelpCategory
FromKeys builds a help screen for a view that does not carry one of its own.
It is deliberately derived rather than written: ShortHelpItems is part of the View contract, so every view — including one added tomorrow — has something to say here, and it is the same list the operator can already see in the help bar. A view with more to explain than its keys implements HelpContent instead; this is the floor, not the ceiling.
type Model ¶
type Model struct {
Viewable viewport.Model
Visible bool
// contains filtered or unexported fields
}
func New ¶
func New(width, height int, cmds []CommandInfo) *Model
func NewCommandHelp ¶
func NewCommandHelp(width, height int, ch CommandHelp) *Model
NewCommandHelp builds the model for the per-command help screen.
func NewDetailed ¶
func NewDetailed(width, height int, categories []HelpCategory) *Model
func (*Model) ApplySearchQuery ¶
ApplySearchQuery implements view.Filterable — filters commands/keybindings.
func (*Model) ClearSearchQuery ¶
func (m *Model) ClearSearchQuery()
ClearSearchQuery implements view.Filterable — clears the filter.