Documentation ¶
Index ¶
- Constants
- Variables
- func Run()
- type Bounds
- type Chunk
- type Doc
- type EventBox
- type EventType
- type Events
- type Input
- type Machine
- type Output
- type Prog
- type Query
- type Reader
- type Result
- type Terminal
- func (t *Terminal) ClearBounds()
- func (t *Terminal) Close()
- func (t *Terminal) GetSize()
- func (t *Terminal) Init(files int)
- func (t *Terminal) Loop()
- func (t *Terminal) Refresh()
- func (t *Terminal) RefreshPrompt()
- func (t *Terminal) UpdateBounds(x *Result)
- func (t *Terminal) UpdateChunks(docs []*Doc, final bool)
- func (t *Terminal) UpdatePrompt(s string)
Constants ¶
View Source
const ( KEY_CTRLB = 2 KEY_CTRLC = 3 KEY_CTRLD = 4 KEY_CTRLF = 6 KEY_CTRLH = 8 KEY_CTRLJ = 10 KEY_CTRLK = 11 KEY_CTRLL = 12 KEY_ENTER = 13 KEY_CTRLT = 20 KEY_ESC = 27 KEY_BACKSPACE = 127 KEY_LEFT = 279168 KEY_RIGHT = 279167 KEY_DEL = 2791126 )
View Source
const ChunkSize int = 250
number of lines in a chunk
Variables ¶
View Source
var TABSTOP int = 8
number of spaces in a tab
Functions ¶
Types ¶
type EventBox ¶
type EventBox struct {
// contains filtered or unexported fields
}
func NewEventBox ¶
func NewEventBox() *EventBox
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
func NewMachine ¶
func (*Machine) Loop ¶
func (m *Machine) Loop()
Loop keep applying regexp to m.doc starting at m.curr
func (*Machine) Snapshot ¶
Snapshot returns a copy of the current outputs of the regexp program It is called inside a critical section
func (*Machine) UpdateMachine ¶
UpdateMachine updates the regexp if possible
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output.output is what gets printed at the end
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader acts as the model
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result goes to tui for display
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal acts as the view
func NewTerminal ¶
func (*Terminal) ClearBounds ¶
func (t *Terminal) ClearBounds()
func (*Terminal) Close ¶
func (t *Terminal) Close()
Close closes alternate screen buffer and restores original terminal state
func (*Terminal) Init ¶
Init saves current state of terminal, sets up raw mode and alternate screen buffer
func (*Terminal) RefreshPrompt ¶
func (t *Terminal) RefreshPrompt()
RefreshPrompt refreshes just the prompt line
func (*Terminal) UpdateBounds ¶
func (*Terminal) UpdateChunks ¶
UpdateChunks saves input snapshot
func (*Terminal) UpdatePrompt ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.