Documentation ¶
Index ¶
- Constants
- Variables
- type AllowPanics
- type BracketedPaste
- type Color
- type Completion
- type Config
- type Editor
- type Hyperlink
- type KeyBinding
- type KeybindingCallback
- type LineMetrics
- type Mask
- type MaskMode
- type MaskedChar
- type PasteHandler
- type RefreshBehavior
- type SignalHandler
- type Span
- type SpanMode
- type StringMetrics
- type Style
- type TabCompletionHandler
- type VTState
- type Winsize
- type XtermColor
Constants ¶
View Source
const ( ModifierShift = 1 ModifierAlt = 2 ModifierCtrl = 4 )
Variables ¶
View Source
var StyleReset = Style{ ForegroundColor: Color{ Xterm8: XtermColorDefault, IsXterm: true, HasValue: true, }, BackgroundColor: Color{ Xterm8: XtermColorDefault, IsXterm: true, HasValue: true, }, Hyperlink: "", }
Functions ¶
This section is empty.
Types ¶
type BracketedPaste ¶
type BracketedPaste int
const ( BracketedPasteEnabled BracketedPaste = iota BracketedPasteDisabled )
type Color ¶
func MakeXtermColor ¶
func MakeXtermColor(color XtermColor) Color
type Completion ¶
type Config ¶
type Config struct { RefreshBehavior RefreshBehavior SignalHandler SignalHandler AllowPanics AllowPanics BracketedPaste BracketedPaste }
type Editor ¶
type Editor interface { Initialize() GetLine(prompt string) (string, error) AddToHistory(line string) LoadHistory(path string) error SaveHistory(path string) error RegisterKeybinding(keys []key, binding KeybindingCallback) ActualRenderedStringMetrics(line string) StringMetrics SetTabCompletionHandler(handler TabCompletionHandler) SetPasteHandler(handler PasteHandler) SetInterruptHandler(handler func()) SetRefreshHandler(handler func(editor Editor)) SetLine(string) Line() string LineUpTo(n uint32) string SetPrompt(prompt string) NumLines() uint32 InsertString(str string) InsertChar(ch rune) Stylize(span Span, style Style) StripStyles() TransformSuggestionOffsets(invariant uint32, static uint32, mode SpanMode) (uint32, uint32) TerminalSize() Winsize Finish() Reset() IsEditing() bool }
func NewEditorWithConfig ¶
type KeyBinding ¶
type KeyBinding struct {
// contains filtered or unexported fields
}
type KeybindingCallback ¶
type LineMetrics ¶
type LineMetrics struct { MaskedChars []MaskedChar Length uint32 }
func (*LineMetrics) TotalLength ¶
func (m *LineMetrics) TotalLength() uint32
type MaskedChar ¶
type PasteHandler ¶
type RefreshBehavior ¶
type RefreshBehavior int
const ( RefreshBehaviorLazy RefreshBehavior = iota RefreshBehaviorEager )
type SignalHandler ¶
type SignalHandler int
const ( SignalHandlerEnabled SignalHandler = iota SignalHandlerDisabled )
type StringMetrics ¶
type StringMetrics struct { LineMetrics []LineMetrics TotalLength uint32 MaxLineLength uint32 }
func (*StringMetrics) LinesWithAddition ¶
func (m *StringMetrics) LinesWithAddition(offset *StringMetrics, columnWidth uint32) uint32
func (*StringMetrics) OffsetWithAddition ¶
func (m *StringMetrics) OffsetWithAddition(offset *StringMetrics, columnWidth uint32) uint32
func (*StringMetrics) Reset ¶
func (m *StringMetrics) Reset()
type Style ¶
type TabCompletionHandler ¶
type TabCompletionHandler func(editor Editor) []Completion
type XtermColor ¶
type XtermColor int
const ( XtermColorBlack XtermColor = iota XtermColorRed XtermColorGreen XtermColorYellow XtermColorBlue XtermColorMagenta XtermColorCyan XtermColorWhite XtermColorUnchanged XtermColorDefault )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.