MCPcopy Index your code
hub / github.com/codehamr/codehamr / historyDown

Method historyDown

internal/tui/keys.go:155–166  ·  view source on GitHub ↗

historyDown walks one step toward newer entries; -1 is the live draft sentinel and restores an empty textarea.

()

Source from the content-addressed store, hash-verified

153// historyDown walks one step toward newer entries; -1 is the live draft
154// sentinel and restores an empty textarea.
155func (m Model) historyDown() Model {
156 if m.histIdx == -1 {
157 return m
158 }
159 m.histIdx--
160 if m.histIdx == -1 {
161 m.ta.Restore(m.histDraft)
162 } else {
163 m.ta.Restore(m.promptHistory[len(m.promptHistory)-1-m.histIdx])
164 }
165 return m
166}
167
168// handleTab implements the three Tab behaviours: seed "/" on an empty prompt
169// (opens the command popover), complete a unique match when the popover is

Callers 1

handleKeyMethod · 0.95

Calls 1

RestoreMethod · 0.80

Tested by

no test coverage detected