Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action int
Action is what a keypress amounted to, for whoever is driving the input.
const ( Drawn Action = iota // the line changed, and wants drawing again Accept // the line is finished Cancel // escape, or ctrl+d while a turn runs: stop whatever is running Quit // ctrl+d on an empty line with nothing running Write // ctrl+x w: swap whether files in the workspace may be changed Shell // ctrl+x x: swap whether shell commands may run at all Git // ctrl+x g: swap whether a repository's own history may be changed Background // ctrl+x b: swap whether commands may leave processes behind Restart // ctrl+r: start the harness again, carrying the conversation over )
What a keypress can amount to.
type Frame ¶
type Frame struct {
Rows []string // the rows to draw
Row int // the row the cursor is on
Column int // the column the cursor is at
Above int // the rows out of sight above
Below int // the rows out of sight below
}
Frame is the visible input rows, cursor position, and clipped row counts.
type History ¶
type History struct {
// contains filtered or unexported fields
}
History is the entries typed before, oldest first, one per line of the file with newlines escaped.
func NewHistory ¶
NewHistory reads the history file. A missing one is what a first run looks like.
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input edits a line and walks its history.
func (*Input) Apply ¶
Apply handles one keypress. Ctrl+D cancels a running turn, quits on an empty idle line, and otherwise does nothing.
Click to show internal directories.
Click to hide internal directories.