Documentation
¶
Overview ¶
Package input holds the pieces that sit between the terminal and the update loop (doc 02 section 14): a filter that coalesces high-rate mouse traffic so a wheel flick cannot starve the keyboard, and the external editor escape hatch for prompts that outgrow a textarea.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenEditor ¶
OpenEditor suspends the TUI, opens the user's editor on the prompt content with the cursor at line and col (both 1-based), and delivers EditorClosed with the edited text. The temp file is .md so the editor lights up markdown; it is removed after reading back.
Types ¶
type CoalescedWheel ¶
CoalescedWheel is the message a burst of wheel events becomes. Delta is the summed step count, positive scrolling down, matching the sign ScrollBy takes. X and Y are from the latest event, for hit-testing which pane the wheel is over.
type EditorClosed ¶
EditorClosed reports the external editor closing: the edited text, or the error that kept it from round-tripping.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter coalesces mouse motion and wheel events before they reach Update. Wheel deltas accumulate so a fast scroll is one message with a summed delta, not a storm; everything else passes through untouched so coalescing can never cost a keystroke. Plug it in with tea.WithFilter(f.Filter).