Documentation ¶
Index ¶
- Constants
- func IsValidLayoutType(v LayoutType) bool
- func IsValidVerticalAnchor(anchor VerticalAnchor) bool
- func LocateRcfile(locater configLocateFunc) (string, error)
- type Action
- type ActionFunc
- type ActionMap
- type AnchorSettings
- type BasicLayout
- type Buffer
- type CLI
- type CLIOptions
- type Caret
- type Config
- type CustomFilterConfig
- type DrawOptions
- type Filter
- type FilterQuery
- type FilteredBuffer
- type Input
- type Inputseq
- type JumpToLineRequest
- type Keymap
- type Keyseq
- type Layout
- type LayoutType
- type ListArea
- type Location
- func (l Location) Column() int
- func (l Location) LineNumber() int
- func (l Location) MaxPage() int
- func (l Location) Offset() int
- func (l Location) Page() int
- func (l Location) PageCrop() PageCrop
- func (l Location) PerPage() int
- func (l *Location) SetColumn(n int)
- func (l *Location) SetLineNumber(n int)
- func (l *Location) SetMaxPage(n int)
- func (l *Location) SetOffset(n int)
- func (l *Location) SetPage(n int)
- func (l *Location) SetPerPage(n int)
- func (l *Location) SetTotal(n int)
- func (l Location) Total() int
- type MatchIndexer
- type MemoryBuffer
- type MessageHub
- type PageCrop
- type PagingRequest
- type PagingRequestType
- type Peco
- func (p *Peco) ApplyConfig(opts CLIOptions) error
- func (p *Peco) Caret() *Caret
- func (p *Peco) CurrentLineBuffer() Buffer
- func (p *Peco) Err() error
- func (p *Peco) ExecQuery() bool
- func (p *Peco) Exit(err error)
- func (p *Peco) Filters() *filter.Set
- func (p *Peco) Hub() MessageHub
- func (p *Peco) Inputseq() *Inputseq
- func (p *Peco) Keymap() Keymap
- func (p *Peco) LayoutType() string
- func (p *Peco) Location() *Location
- func (p *Peco) PrintResults()
- func (p *Peco) Prompt() string
- func (p *Peco) Query() *Query
- func (p *Peco) QueryExecDelay() time.Duration
- func (p *Peco) Ready() <-chan struct{}
- func (p *Peco) ResetCurrentLineBuffer()
- func (p *Peco) ResultCh() chan line.Line
- func (p *Peco) Run(ctx context.Context) (err error)
- func (p *Peco) Screen() Screen
- func (p *Peco) Selection() *Selection
- func (p *Peco) SelectionRangeStart() *RangeStart
- func (p *Peco) SetCurrentLineBuffer(b Buffer)
- func (p *Peco) SetResultCh(ch chan line.Line)
- func (p *Peco) SetSingleKeyJumpMode(b bool)
- func (p *Peco) Setup() (err error)
- func (p *Peco) SetupSource(ctx context.Context) (s *Source, err error)
- func (p *Peco) SingleKeyJumpIndex(ch rune) (uint, bool)
- func (p *Peco) SingleKeyJumpMode() bool
- func (p *Peco) SingleKeyJumpPrefixes() []rune
- func (p *Peco) SingleKeyJumpShowPrefix() bool
- func (p *Peco) Source() pipeline.Source
- func (p *Peco) Styles() *StyleSet
- func (p *Peco) ToggleSingleKeyJumpMode()
- type PrintArgs
- type Query
- func (q *Query) DeleteRange(start, end int)
- func (q *Query) InsertAt(ch rune, where int)
- func (q *Query) Len() int
- func (q *Query) Reset()
- func (q *Query) RestoreSavedQuery()
- func (q *Query) RuneAt(where int) rune
- func (q *Query) Runes() <-chan rune
- func (q *Query) SaveQuery()
- func (q *Query) Set(s string)
- func (q *Query) String() string
- type RangeStart
- type Screen
- type Selection
- type SingleKeyJumpConfig
- type Source
- func (s *Source) Append(l line.Line)
- func (s *Source) LineAt(n int) (line.Line, error)
- func (s *Source) Name() string
- func (s *Source) Ready() <-chan struct{}
- func (s *Source) Reset()
- func (s *Source) Setup(ctx context.Context, state *Peco)
- func (s *Source) SetupDone() <-chan struct{}
- func (s *Source) Size() int
- func (s *Source) Start(ctx context.Context, out pipeline.ChanOutput)
- type State
- type StatusBar
- type Style
- type StyleSet
- type Termbox
- func (t *Termbox) Close() error
- func (t *Termbox) Flush() error
- func (t *Termbox) Init() error
- func (t *Termbox) PollEvent(ctx context.Context) chan termbox.Event
- func (t *Termbox) PostInit() error
- func (t *Termbox) Print(args PrintArgs) int
- func (t *Termbox) Resume()
- func (t *Termbox) SendEvent(_ termbox.Event)
- func (t *Termbox) SetCell(x, y int, ch rune, fg, bg termbox.Attribute)
- func (t *Termbox) Size() (int, int)
- func (t *Termbox) Suspend()
- type UserPrompt
- type VerticalAnchor
- type View
Constants ¶
const ( DefaultLayoutType = LayoutTypeTopDown // LayoutTypeTopDown makes the layout so the items read from top to bottom LayoutTypeTopDown = "top-down" // LayoutTypeBottomUp changes the layout to read from bottom to up LayoutTypeBottomUp = "bottom-up" )
const ( IgnoreCaseMatch = "IgnoreCase" CaseSensitiveMatch = "CaseSensitive" SmartCaseMatch = "SmartCase" RegexpMatch = "Regexp" )
These are used as keys in the config file
Variables ¶
This section is empty.
Functions ¶
func IsValidLayoutType ¶ added in v0.2.5
func IsValidLayoutType(v LayoutType) bool
IsValidLayoutType checks if a string is a supported layout type
func IsValidVerticalAnchor ¶ added in v0.2.6
func IsValidVerticalAnchor(anchor VerticalAnchor) bool
IsValidVerticalAnchor checks if the specified anchor is supported
func LocateRcfile ¶ added in v0.1.3
LocateRcfile attempts to find the config file in various locations
Types ¶
type Action ¶ added in v0.2.0
type Action interface { Register(string, ...termbox.Key) RegisterKeySequence(string, keyseq.KeyList) Execute(context.Context, *Peco, termbox.Event) }
Action describes an action that can be executed upon receiving user input. It's an interface so you can create any kind of Action you need, but most everything is implemented in terms of ActionFunc, which is callback based Action
type ActionFunc ¶ added in v0.2.0
ActionFunc is a type of Action that is basically just a callback.
func (ActionFunc) Execute ¶ added in v0.2.0
func (a ActionFunc) Execute(ctx context.Context, state *Peco, e termbox.Event)
Execute fulfills the Action interface for AfterFunc
func (ActionFunc) Register ¶ added in v0.2.0
func (a ActionFunc) Register(name string, defaultKeys ...termbox.Key)
Register fulfills the Action interface for AfterFunc. Registers `a` into the global action registry by the name `name`, and maps to default keys via `defaultKeys`
func (ActionFunc) RegisterKeySequence ¶ added in v0.2.0
func (a ActionFunc) RegisterKeySequence(name string, k keyseq.KeyList)
RegisterKeySequence satisfies the Action interface for AfterFunc. Registers the action to be mapped against a key sequence
type AnchorSettings ¶ added in v0.2.5
type AnchorSettings struct {
// contains filtered or unexported fields
}
AnchorSettings groups items that are required to control where an anchored item is actually placed
func NewAnchorSettings ¶ added in v0.2.6
func NewAnchorSettings(screen Screen, anchor VerticalAnchor, offset int) *AnchorSettings
NewAnchorSettings creates a new AnchorSetting struct. Panics if an unknown VerticalAnchor is sent
func (AnchorSettings) AnchorPosition ¶ added in v0.2.5
func (as AnchorSettings) AnchorPosition() int
AnchorPosition returns the starting y-offset, based on the anchor type and offset
type BasicLayout ¶ added in v0.2.5
type BasicLayout struct { *StatusBar // contains filtered or unexported fields }
BasicLayout is... the basic layout :) At this point this is the only struct for layouts, which means that while the position of components may be configurable, the actual types of components that are used are set and static
func NewBottomUpLayout ¶ added in v0.2.5
func NewBottomUpLayout(state *Peco) *BasicLayout
NewBottomUpLayout creates a new Layout in bottom-up format
func NewDefaultLayout ¶ added in v0.2.5
func NewDefaultLayout(state *Peco) *BasicLayout
NewDefaultLayout creates a new Layout in the default format (top-down)
func (*BasicLayout) CalculatePage ¶ added in v0.2.5
func (l *BasicLayout) CalculatePage(state *Peco, perPage int) error
CalculatePage calculates which page we're displaying
func (*BasicLayout) DrawPrompt ¶ added in v0.2.9
func (l *BasicLayout) DrawPrompt(state *Peco)
DrawPrompt draws the prompt to the terminal
func (*BasicLayout) DrawScreen ¶ added in v0.2.5
func (l *BasicLayout) DrawScreen(state *Peco, options *DrawOptions)
DrawScreen draws the entire screen
func (*BasicLayout) MovePage ¶ added in v0.2.5
func (l *BasicLayout) MovePage(state *Peco, p PagingRequest) (moved bool)
MovePage scrolls the screen
func (*BasicLayout) PurgeDisplayCache ¶ added in v0.3.4
func (l *BasicLayout) PurgeDisplayCache()
type Buffer ¶ added in v0.4.0
type Buffer interface { LineAt(int) (line.Line, error) Size() int // contains filtered or unexported methods }
Buffer interface is used for containers for lines to be processed by peco.
type CLIOptions ¶ added in v0.3.0
type CLIOptions struct { OptHelp bool `short:"h" long:"help" description:"show this help message and exit"` OptQuery string `long:"query" description:"initial value for query"` OptRcfile string `long:"rcfile" description:"path to the settings file"` OptVersion bool `long:"version" description:"print the version and exit"` OptBufferSize int `long:"buffer-size" short:"b" description:"number of lines to keep in search buffer"` OptEnableNullSep bool `long:"null" description:"expect NUL (\\0) as separator for target/output"` OptInitialIndex int `long:"initial-index" description:"position of the initial index of the selection (0 base)"` OptInitialMatcher string `long:"initial-matcher" description:"specify the default matcher (deprecated)"` OptInitialFilter string `long:"initial-filter" description:"specify the default filter"` OptPrompt string `long:"prompt" description:"specify the prompt string"` OptLayout string `long:"layout" description:"layout to be used. 'top-down' or 'bottom-up'. default is 'top-down'"` OptSelect1 bool `long:"select-1" description:"select first item and immediately exit if the input contains only 1 item"` OptOnCancel string `` /* 141-byte string literal not displayed */ OptSelectionPrefix string `` /* 174-byte string literal not displayed */ OptExec string `` /* 204-byte string literal not displayed */ }
func (CLIOptions) Validate ¶ added in v0.4.0
func (options CLIOptions) Validate() error
type Config ¶
type Config struct { Action map[string][]string `json:"Action"` // Keymap used to be directly responsible for dispatching // events against user input, but since then this has changed // into something that just records the user's config input Keymap map[string]string `json:"Keymap"` Matcher string `json:"Matcher"` // Deprecated. InitialMatcher string `json:"InitialMatcher"` // Use this instead of Matcher InitialFilter string `json:"InitialFilter"` Style StyleSet `json:"Style"` Prompt string `json:"Prompt"` Layout string `json:"Layout"` OnCancel string `json:"OnCancel"` CustomMatcher map[string][]string CustomFilter map[string]CustomFilterConfig QueryExecutionDelay int StickySelection bool MaxScanBufferSize int // If this is true, then the prefix for single key jump mode // is displayed by default. SingleKeyJump SingleKeyJumpConfig `json:"SingleKeyJump"` // Use this prefix to denote currently selected line SelectionPrefix string `json:"SelectionPrefix"` }
Config holds all the data that can be configured in the external configuration file
func (*Config) ReadFilename ¶
ReadFilename reads the config from the given file, and does the appropriate processing, if any
type CustomFilterConfig ¶ added in v0.3.0
type CustomFilterConfig struct { // Cmd is the name of the command to invoke Cmd string // TODO: need to check if how we use this is correct Args []string // BufferThreshold defines how many lines peco buffers before // invoking the external command. If this value is big, we // will execute the external command fewer times, but the // results will not be generated for longer periods of time. // If this value is small, we will execute the external command // more often, but you pay the penalty of invoking that command // more times. BufferThreshold int }
CustomFilterConfig is used to specify configuration parameters to CustomFilters
type DrawOptions ¶ added in v0.4.2
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is responsible for the actual "grep" part of peco
type FilterQuery ¶ added in v0.2.6
type FilterQuery Query
type FilteredBuffer ¶ added in v0.4.0
type FilteredBuffer struct {
// contains filtered or unexported fields
}
FilteredBuffer holds a "filtered" buffer. It holds a reference to the source buffer (note: should be immutable) and a list of indices into the source buffer
func NewFilteredBuffer ¶ added in v0.4.0
func NewFilteredBuffer(src Buffer, page, perPage int) *FilteredBuffer
func (FilteredBuffer) LineAt ¶ added in v0.4.0
func (flb FilteredBuffer) LineAt(i int) (line.Line, error)
LineAt returns the line at index `i`. Note that the i-th element in this filtered buffer may actually correspond to a totally different line number in the source buffer.
func (*FilteredBuffer) MaxColumn ¶ added in v0.5.1
func (flb *FilteredBuffer) MaxColumn() int
MaxColumn returns the max column size, which controls the amount we can scroll to the right
func (FilteredBuffer) Size ¶ added in v0.4.0
func (flb FilteredBuffer) Size() int
Size returns the number of lines in the buffer
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
type Inputseq ¶ added in v0.4.0
type Inputseq []string
Inputseq is a list of keys that the user typed
type JumpToLineRequest ¶ added in v0.3.4
type JumpToLineRequest int
func (JumpToLineRequest) Line ¶ added in v0.3.4
func (jlr JumpToLineRequest) Line() int
func (JumpToLineRequest) Type ¶ added in v0.3.4
func (jlr JumpToLineRequest) Type() PagingRequestType
type Keymap ¶
type Keymap struct { Config map[string]string Action map[string][]string // custom actions // contains filtered or unexported fields }
Keymap holds all the key sequence to action map
func (*Keymap) ApplyKeybinding ¶ added in v0.2.0
ApplyKeybinding applies all of the custom key bindings on top of the default key bindings
func (Keymap) ExecuteAction ¶ added in v0.4.0
func (Keymap) LookupAction ¶ added in v0.3.4
LookupAction returns the appropriate action for the given termbox event
type Layout ¶ added in v0.2.5
type Layout interface { PrintStatus(string, time.Duration) DrawPrompt(*Peco) DrawScreen(*Peco, *DrawOptions) MovePage(*Peco, PagingRequest) (moved bool) PurgeDisplayCache() }
Layout represents the component that controls where elements are placed on screen
type LayoutType ¶ added in v0.2.5
type LayoutType string
LayoutType describes the types of layout that peco can take
type ListArea ¶ added in v0.2.5
type ListArea struct { *AnchorSettings // contains filtered or unexported fields }
ListArea represents the area where the actual line buffer is displayed in the screen
func NewListArea ¶ added in v0.2.5
func NewListArea(screen Screen, anchor VerticalAnchor, anchorOffset int, sortTopDown bool, styles *StyleSet) *ListArea
NewListArea creates a new ListArea struct
type Location ¶ added in v0.4.0
type Location struct {
// contains filtered or unexported fields
}
func (Location) LineNumber ¶ added in v0.4.0
func (*Location) SetLineNumber ¶ added in v0.4.0
func (*Location) SetMaxPage ¶ added in v0.4.0
func (*Location) SetPerPage ¶ added in v0.4.0
type MatchIndexer ¶ added in v0.4.7
type MatchIndexer interface { // Indices return the matched portion(s) of a string after filtering. // Note that while Indices may return nil, that just means that there are // no substrings to be highlighted. It doesn't mean there were no matches Indices() [][]int }
type MemoryBuffer ¶ added in v0.4.0
type MemoryBuffer struct { PeriodicFunc func() // contains filtered or unexported fields }
MemoryBuffer is an implementation of Buffer
func NewMemoryBuffer ¶ added in v0.4.0
func NewMemoryBuffer() *MemoryBuffer
func (*MemoryBuffer) Accept ¶ added in v0.4.0
func (mb *MemoryBuffer) Accept(ctx context.Context, in chan interface{}, _ pipeline.ChanOutput)
func (*MemoryBuffer) Done ¶ added in v0.4.0
func (mb *MemoryBuffer) Done() <-chan struct{}
func (*MemoryBuffer) LineAt ¶ added in v0.4.0
func (mb *MemoryBuffer) LineAt(n int) (line.Line, error)
func (*MemoryBuffer) Reset ¶ added in v0.4.0
func (mb *MemoryBuffer) Reset()
func (*MemoryBuffer) Size ¶ added in v0.4.0
func (mb *MemoryBuffer) Size() int
type MessageHub ¶ added in v0.4.4
type MessageHub interface { Batch(func(), bool) DrawCh() chan hub.Payload PagingCh() chan hub.Payload QueryCh() chan hub.Payload SendDraw(interface{}) SendDrawPrompt() SendPaging(interface{}) SendQuery(string) SendStatusMsg(string) SendStatusMsgAndClear(string, time.Duration) StatusMsgCh() chan hub.Payload }
MessageHub is the interface that must be satisfied by the message hub component. Unless we're in testing, github.com/peco/peco/hub.Hub is used.
type PageCrop ¶ added in v0.3.0
type PageCrop struct {
// contains filtered or unexported fields
}
PageCrop filters out a new LineBuffer based on entries per page and the page number
func (PageCrop) Crop ¶ added in v0.3.0
func (pf PageCrop) Crop(in Buffer) *FilteredBuffer
Crop returns a new Buffer whose contents are bound within the given range
type PagingRequest ¶
type PagingRequest interface {
Type() PagingRequestType
}
type PagingRequestType ¶ added in v0.3.4
type PagingRequestType int
PagingRequest can be sent to move the selection cursor
const ( ToLineAbove PagingRequestType = iota // ToLineAbove moves the selection to the line above ToScrollPageDown // ToScrollPageDown moves the selection to the next page ToLineBelow // ToLineBelow moves the selection to the line below ToScrollPageUp // ToScrollPageUp moves the selection to the previous page ToScrollLeft // ToScrollLeft scrolls screen to the left ToScrollRight // ToScrollRight scrolls screen to the right ToLineInPage // ToLineInPage jumps to a particular line on the page )
func (PagingRequestType) String ¶ added in v0.4.0
func (i PagingRequestType) String() string
func (PagingRequestType) Type ¶ added in v0.3.4
func (prt PagingRequestType) Type() PagingRequestType
type Peco ¶ added in v0.4.0
type Peco struct { Argv []string Stdin io.Reader Stdout io.Writer Stderr io.Writer // contains filtered or unexported fields }
Peco is the global object containing everything required to run peco. It also contains the global state of the program.
func (*Peco) ApplyConfig ¶ added in v0.4.0
func (p *Peco) ApplyConfig(opts CLIOptions) error
func (*Peco) CurrentLineBuffer ¶ added in v0.4.0
func (*Peco) Hub ¶ added in v0.4.0
func (p *Peco) Hub() MessageHub
func (*Peco) LayoutType ¶ added in v0.4.0
func (*Peco) PrintResults ¶ added in v0.4.6
func (p *Peco) PrintResults()
func (*Peco) QueryExecDelay ¶ added in v0.4.0
func (*Peco) ResetCurrentLineBuffer ¶ added in v0.4.0
func (p *Peco) ResetCurrentLineBuffer()
func (*Peco) SelectionRangeStart ¶ added in v0.4.0
func (p *Peco) SelectionRangeStart() *RangeStart
func (*Peco) SetCurrentLineBuffer ¶ added in v0.4.0
func (*Peco) SetResultCh ¶ added in v0.4.0
func (*Peco) SetSingleKeyJumpMode ¶ added in v0.4.0
func (*Peco) SetupSource ¶ added in v0.4.0
func (*Peco) SingleKeyJumpIndex ¶ added in v0.4.0
func (*Peco) SingleKeyJumpMode ¶ added in v0.4.0
func (*Peco) SingleKeyJumpPrefixes ¶ added in v0.4.0
func (*Peco) SingleKeyJumpShowPrefix ¶ added in v0.4.0
func (*Peco) ToggleSingleKeyJumpMode ¶ added in v0.4.0
func (p *Peco) ToggleSingleKeyJumpMode()
type Query ¶ added in v0.4.0
type Query struct {
// contains filtered or unexported fields
}
func (*Query) DeleteRange ¶ added in v0.4.0
func (*Query) RestoreSavedQuery ¶ added in v0.4.0
func (q *Query) RestoreSavedQuery()
type RangeStart ¶ added in v0.4.0
type RangeStart struct {
// contains filtered or unexported fields
}
func (*RangeStart) Reset ¶ added in v0.4.0
func (s *RangeStart) Reset()
func (*RangeStart) SetValue ¶ added in v0.4.0
func (s *RangeStart) SetValue(n int)
func (RangeStart) Valid ¶ added in v0.4.0
func (s RangeStart) Valid() bool
func (RangeStart) Value ¶ added in v0.4.0
func (s RangeStart) Value() int
type Screen ¶ added in v0.2.6
type Screen interface { Init() error Close() error Flush() error PollEvent(context.Context) chan termbox.Event Print(PrintArgs) int Resume() SetCell(int, int, rune, termbox.Attribute, termbox.Attribute) Size() (int, int) SendEvent(termbox.Event) Suspend() }
Screen hides termbox from the consuming code so that it can be swapped out for testing
type Selection ¶ added in v0.1.3
type Selection struct {
// contains filtered or unexported fields
}
Selection stores the line ids that were selected by the user. The contents of the Selection is always sorted from smallest to largest line ID
func NewSelection ¶ added in v0.2.11
func NewSelection() *Selection
NewSelection creates a new empty Selection
func (*Selection) Add ¶ added in v0.1.3
Add adds a new line to the selection. If the line already exists in the selection, it is silently ignored
func (*Selection) Ascend ¶ added in v0.4.0
func (s *Selection) Ascend(i btree.ItemIterator)
type SingleKeyJumpConfig ¶ added in v0.3.4
type SingleKeyJumpConfig struct {
ShowPrefix bool `json:"ShowPrefix"`
}
type Source ¶ added in v0.4.0
type Source struct { pipeline.ChanOutput // contains filtered or unexported fields }
Source implements pipeline.Source, and is the buffer for the input
func NewSource ¶ added in v0.4.0
func NewSource(name string, in io.Reader, idgen line.IDGenerator, capacity int, enableSep bool) *Source
Creates a new Source. Does not start processing the input until you call Setup()
func (*Source) Ready ¶ added in v0.4.0
func (s *Source) Ready() <-chan struct{}
Ready returns the "input ready" channel. It will be closed as soon as the first line of input is processed via Setup()
func (*Source) Reset ¶ added in v0.4.0
func (s *Source) Reset()
Reset resets the state of the source object so that it is ready to feed the filters
type StatusBar ¶ added in v0.2.5
type StatusBar struct { *AnchorSettings // contains filtered or unexported fields }
StatusBar draws the status message bar
func NewStatusBar ¶ added in v0.2.5
func NewStatusBar(screen Screen, anchor VerticalAnchor, anchorOffset int, styles *StyleSet) *StatusBar
NewStatusBar creates a new StatusBar struct
type Style ¶ added in v0.1.2
type Style struct {
// contains filtered or unexported fields
}
Style describes termbox styles
func (*Style) UnmarshalJSON ¶ added in v0.1.2
UnmarshalJSON satisfies json.RawMessage.
type StyleSet ¶ added in v0.1.2
type StyleSet struct { Basic Style `json:"Basic"` SavedSelection Style `json:"SavedSelection"` Selected Style `json:"Selected"` Query Style `json:"Query"` Matched Style `json:"Matched"` }
StyleSet holds styles for various sections
func NewStyleSet ¶ added in v0.1.2
func NewStyleSet() *StyleSet
NewStyleSet creates a new StyleSet struct
type Termbox ¶ added in v0.2.6
type Termbox struct {
// contains filtered or unexported fields
}
Termbox just hands out the processing to the termbox library
func NewTermbox ¶ added in v0.5.0
func NewTermbox() *Termbox
func (*Termbox) PollEvent ¶ added in v0.2.6
PollEvent returns a channel that you can listen to for termbox's events. The actual polling is done in a separate gouroutine
func (*Termbox) SendEvent ¶ added in v0.3.0
func (t *Termbox) SendEvent(_ termbox.Event)
SendEvent is used to allow programmers generate random events, but it's only useful for testing purposes. When interactiving with termbox-go, this method is a noop
type UserPrompt ¶ added in v0.2.5
type UserPrompt struct { *AnchorSettings // contains filtered or unexported fields }
UserPrompt draws the prompt line
func NewUserPrompt ¶ added in v0.2.5
func NewUserPrompt(screen Screen, anchor VerticalAnchor, anchorOffset int, prompt string, styles *StyleSet) *UserPrompt
NewUserPrompt creates a new UserPrompt struct
func (UserPrompt) Draw ¶ added in v0.2.5
func (u UserPrompt) Draw(state *Peco)
Draw draws the query prompt
type VerticalAnchor ¶ added in v0.2.5
type VerticalAnchor int
VerticalAnchor describes the direction to which elements in the layout are anchored to
const ( AnchorTop VerticalAnchor = iota + 1 // AnchorTop anchors elements towards the top of the screen AnchorBottom // AnchorBottom anchors elements towards the bottom of the screen )
func (VerticalAnchor) String ¶ added in v0.4.0
func (i VerticalAnchor) String() string