Documentation
¶
Overview ¶
Package hintbar renders the frame's bottom chrome row: context-sensitive key hints on the left, counters on the right.
It replaces the old status bar's hint strip. Connection state moved to the top bar, so this row is purely "what can I press here" plus "how much is there", and it changes with the interaction mode rather than only with focus.
Index ¶
Constants ¶
const MinGap = 5
MinGap is the smallest space allowed between the last hint and the right group. Derived from the goldens: at 80 columns the bar keeps four hints and exactly five cells of gap, and a fifth hint would not fit.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hint ¶
Hint is one "key label" pair. Key is rendered in the accent colour and label in faint, so the eye can scan keys without reading the labels.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the hint bar.
func (*Model) ClearNotice ¶
func (m *Model) ClearNotice()
func (*Model) SetNotice ¶
SetNotice hands the row to a transient message. kind selects the colour: "error" is red, anything else amber for progress.
func (Model) View ¶
View renders the row at exactly the configured width.
The layout is: one leading space, hints joined by two spaces, padding, the right group, one trailing space. Hints are taken IN ORDER and the bar keeps the longest prefix that still leaves MinGap cells before the right group — so a hint is dropped whole, from the right, and never truncated mid-word.
Because it is a prefix, removing a hint from the middle of the set lets the next one in at narrow widths. That is the intended behaviour and it is what the goldens show: dropping "t thread" gained "e edit" at 100 columns rather than just widening the gap.