Documentation
¶
Index ¶
- Variables
- func AddChildPager(parent, child Pager, creatingKeys string)
- func AddEventHandler(keyStr string, handler func())
- func Close()
- func Confirm(message string, callback func())
- func ConfirmExec(cmd string, ctx Context, callback func())
- func ContextEnvironment(ctx Context) []string
- func Exec(cmd string, ctx Context)
- func Init() error
- func KeyEventFromString(str string) keyEvent
- func KeyEventFromTBEvent(tbev *termbox.Event) keyEvent
- func KeySequenceFromString(str string) []keyEvent
- func LoadConfig(rd io.Reader)
- func PopPager()
- func PushPager(p Pager)
- func Quit()
- func RegisterMode(name string, mode Mode)
- func Run()
- func SetAnnotatorsDir(dir string)
- type Annotation
- type Annotations
- type Annotator
- type Box
- type Buffer
- type Configurer
- type ConfirmPrompt
- type Context
- type EventHandler
- type HandlerRegistry
- type Highlight
- type Highlights
- type KeyConst
- type Line
- type Mode
- type Pager
- type PagerStack
- type Region
- type ShellCommand
- type Stream
- type StreamReader
- type StyledRune
- type TermStyle
- type TermStyles
- type Token
- type TokenReader
- type TokenType
- type Widget
- type WidgetStack
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ConfigDir string
)
Functions ¶
func AddChildPager ¶
func AddEventHandler ¶ added in v0.1.0
func AddEventHandler(keyStr string, handler func())
func ConfirmExec ¶
func ContextEnvironment ¶ added in v0.1.0
func KeyEventFromString ¶
func KeyEventFromString(str string) keyEvent
func KeyEventFromTBEvent ¶
func KeySequenceFromString ¶ added in v0.1.0
func KeySequenceFromString(str string) []keyEvent
TODO: Rewrite to allow commas in here
func LoadConfig ¶
func RegisterMode ¶
func SetAnnotatorsDir ¶ added in v0.0.2
func SetAnnotatorsDir(dir string)
Types ¶
type Annotation ¶
func NewAnnotation ¶
func NewAnnotation(start, end int, class string, val string) Annotation
type Annotations ¶ added in v0.0.2
type Annotations interface {
Add(Annotation)
Intersecting(Region) []Annotation
Len() int
}
func NewAnnotations ¶ added in v0.0.2
func NewAnnotations() Annotations
type Annotator ¶
type Annotator interface {
Annotate(io.Reader) <-chan Annotation
}
func NewExternalAnnotator ¶ added in v0.0.2
func NewMatchAnnotator ¶ added in v0.0.2
func NewRegexAnnotator ¶ added in v0.0.2
type Box ¶
type Box interface {
Left() int
Top() int
Width() int
Height() int
DrawStyledRune(x, y int, sr StyledRune)
DrawStyledRunes(x, y int, runes []StyledRune)
Fill(sr StyledRune)
}
type Buffer ¶
type Configurer ¶
func NewConfigurer ¶
func NewConfigurer() Configurer
type ConfirmPrompt ¶
func NewConfirmPrompt ¶
func NewConfirmPrompt() ConfirmPrompt
type Context ¶
func MergeContext ¶
func NewContextFromAnnotations ¶ added in v0.1.0
func NewContextFromAnnotations(annotations []Annotation) Context
type EventHandler ¶ added in v0.1.0
func NewCtxEventHandler ¶ added in v0.1.0
func NewCtxEventHandler(req []string, h func(Context)) EventHandler
func NewEventHandler ¶ added in v0.1.0
func NewEventHandler(h func()) EventHandler
type HandlerRegistry ¶ added in v0.1.0
type HandlerRegistry interface {
Add([]keyEvent, EventHandler)
Find([]keyEvent) EventHandler
FindCtx([]keyEvent, Context) EventHandler
}
func NewHandlerRegistry ¶ added in v0.1.0
func NewHandlerRegistry() HandlerRegistry
type Highlights ¶ added in v0.0.2
func NewHighlights ¶ added in v0.0.2
func NewHighlights() Highlights
type KeyConst ¶
const ( KeyF1 KeyConst = KeyConst(termbox.KeyF1) KeyF2 KeyConst = KeyConst(termbox.KeyF2) KeyF3 KeyConst = KeyConst(termbox.KeyF3) KeyF4 KeyConst = KeyConst(termbox.KeyF4) KeyF5 KeyConst = KeyConst(termbox.KeyF5) KeyF6 KeyConst = KeyConst(termbox.KeyF6) KeyF7 KeyConst = KeyConst(termbox.KeyF7) KeyF8 KeyConst = KeyConst(termbox.KeyF8) KeyF9 KeyConst = KeyConst(termbox.KeyF9) KeyF10 KeyConst = KeyConst(termbox.KeyF10) KeyF11 KeyConst = KeyConst(termbox.KeyF11) KeyF12 KeyConst = KeyConst(termbox.KeyF12) KeyInsert KeyConst = KeyConst(termbox.KeyInsert) KeyDelete KeyConst = KeyConst(termbox.KeyDelete) KeyHome KeyConst = KeyConst(termbox.KeyHome) KeyEnd KeyConst = KeyConst(termbox.KeyEnd) KeyPgup KeyConst = KeyConst(termbox.KeyPgup) KeyPgdn KeyConst = KeyConst(termbox.KeyPgdn) KeyArrowUp KeyConst = KeyConst(termbox.KeyArrowUp) KeyArrowDown KeyConst = KeyConst(termbox.KeyArrowDown) KeyArrowLeft KeyConst = KeyConst(termbox.KeyArrowLeft) KeyArrowRight KeyConst = KeyConst(termbox.KeyArrowRight) KeyTab KeyConst = KeyConst(termbox.KeyTab) KeyBackspace KeyConst = KeyConst(termbox.KeyBackspace) KeyEnter KeyConst = KeyConst(termbox.KeyEnter) KeyEsc KeyConst = KeyConst(termbox.KeyEsc) KeySpace KeyConst = KeyConst(termbox.KeySpace) )
type Mode ¶
type Pager ¶
type Pager interface {
Widget
AddEventHandler(keyStr string, handler EventHandler)
Reload()
CursorUp()
CursorDown()
CursorFirstLine()
CursorLastLine()
ScrollUp()
ScrollDown()
PageUp()
PageDown()
}
type PagerStack ¶
type PagerStack interface {
Widget
Show(int)
Last() Pager
Push(p Pager)
Pop()
Size() int
AddChild(parent Pager, child Pager, creatingKeys string)
PushAsChild(Pager, string)
ParentCursorUp()
ParentCursorDown()
}
func NewPagerStack ¶
func NewPagerStack() PagerStack
type ShellCommand ¶ added in v0.0.2
type ShellCommand interface {
io.ReadCloser
}
func NewShellCommand ¶ added in v0.0.2
func NewShellCommand(c string, ctx Context) (ShellCommand, error)
type Stream ¶ added in v0.0.2
type Stream interface {
io.WriteCloser
Bytes() []byte
NewReader() StreamReader
}
type StreamReader ¶ added in v0.0.2
type StyledRune ¶
func NewStyledRune ¶
func NewStyledRune(ch rune, ts TermStyle) StyledRune
func StyledRunesFromString ¶
func StyledRunesFromString(str string, ts TermStyle) []StyledRune
type TermStyles ¶ added in v0.0.2
type TermStyles interface {
Get(termbox.Attribute, termbox.Attribute) TermStyle
Default() TermStyle
}
func NewTermStyles ¶ added in v0.0.2
func NewTermStyles() TermStyles
type TokenReader ¶ added in v0.0.2
func NewScanner ¶ added in v0.0.2
func NewScanner(rd io.Reader) TokenReader
type WidgetStack ¶
func NewWidgetStack ¶
func NewWidgetStack() WidgetStack
Click to show internal directories.
Click to hide internal directories.