Documentation
¶
Index ¶
- Constants
- Variables
- func ClearLine()
- func CloseProps()
- func ColorBlue()
- func ColorBold()
- func ColorBrGreen()
- func ColorCyan()
- func ColorGreen()
- func ColorMagenta()
- func ColorOrange()
- func ColorRed()
- func ColorWhite()
- func CurDown(n int)
- func CurLeft(n int)
- func CurRight(n int)
- func CurUp(n int)
- func DisplayBlock(bloc env.Block, idx *env.Idxs) (env.Object, bool)
- func DisplayDict(bloc env.Dict, idx *env.Idxs) (env.Object, bool)
- func DisplaySpreadsheetRow(bloc env.SpreadsheetRow, idx *env.Idxs) (env.Object, bool)
- func DisplayTable(bloc env.Spreadsheet, idx *env.Idxs) (env.Object, bool)
- func GetTerminalColumns() int
- func HideCur()
- func ResetBold()
- func RestoreCurPos()
- func RyeHighlight(s string, inStrX bool, columns int) (string, bool)
- func SaveCurPos()
- func SetSB(fn func(string))
- func SetTerminalColumns(c int)
- func ShowCur()
- type Completer
- type HighlightedStringBuilder
- type KeyEvent
- type MLState
- type WordCompleter
Constants ¶
const HistoryLimit = 1000
HistoryLimit is the maximum number of entries saved in the scrollback history.
Variables ¶
var ColumnNum int
Functions ¶
func CloseProps ¶ added in v0.0.15
func CloseProps()
func ColorBrGreen ¶ added in v0.0.15
func ColorBrGreen()
func ColorGreen ¶ added in v0.0.15
func ColorGreen()
func ColorMagenta ¶ added in v0.0.15
func ColorMagenta()
func ColorOrange ¶ added in v0.0.15
func ColorOrange()
func ColorWhite ¶ added in v0.0.15
func ColorWhite()
func DisplayDict ¶
DisplayDict is dummy non-implementation for wasm for display builtin
func DisplaySpreadsheetRow ¶
DisplaySpreadsheetRow is dummy non-implementation for wasm for display builtin
func DisplayTable ¶
DisplayTable is dummy non-implementation for wasm for display builtin
func GetTerminalColumns ¶ added in v0.0.26
func GetTerminalColumns() int
func RestoreCurPos ¶ added in v0.0.15
func RestoreCurPos()
func RyeHighlight ¶ added in v0.0.26
func SaveCurPos ¶
func SaveCurPos()
func SetTerminalColumns ¶ added in v0.0.27
func SetTerminalColumns(c int)
Types ¶
type Completer ¶ added in v0.0.26
Completer takes the currently edited line content at the left of the cursor to the completer which may return {"Hello, world", "Hello, Word"} to have "Hello, world!!!".
type HighlightedStringBuilder ¶ added in v0.0.26
type HighlightedStringBuilder struct {
// contains filtered or unexported fields
}
func (*HighlightedStringBuilder) ColoredString ¶ added in v0.0.26
func (h *HighlightedStringBuilder) ColoredString(inStr bool) string
func (*HighlightedStringBuilder) Reset ¶ added in v0.0.26
func (h *HighlightedStringBuilder) Reset()
func (*HighlightedStringBuilder) String ¶ added in v0.0.26
func (h *HighlightedStringBuilder) String() string
func (*HighlightedStringBuilder) WriteRune ¶ added in v0.0.26
func (h *HighlightedStringBuilder) WriteRune(c rune)
type MLState ¶ added in v0.0.26
type MLState struct {
// contains filtered or unexported fields
}
State represents an open terminal
func NewMicroLiner ¶ added in v0.0.26
NewLiner initializes a new *State, and sets the terminal into raw mode. To restore the terminal to its previous state, call State.Close().
func (*MLState) AppendHistory ¶ added in v0.0.26
AppendHistory appends an entry to the scrollback history. AppendHistory should be called iff Prompt returns a valid command.
func (*MLState) ClearHistory ¶ added in v0.0.26
func (s *MLState) ClearHistory()
ClearHistory clears the scrollback history.
func (*MLState) MicroPrompt ¶ added in v0.0.26
func (s *MLState) MicroPrompt(prompt string, text string, pos int, ctx1 context.Context) (string, error)
signals end-of-file by pressing Ctrl-D.
func (*MLState) SetColumns ¶ added in v0.0.27
func (*MLState) SetCompleter ¶ added in v0.0.26
SetCompleter sets the completion function that Liner will call to fetch completion candidates when the user presses tab.
type WordCompleter ¶ added in v0.0.26
type WordCompleter func(line string, pos int, mode int) (head string, completions []string, tail string)
WordCompleter takes the currently edited line with the cursor position and to the completer which may returns ("Hello, ", {"world", "Word"}, "!!!") to have "Hello, world!!!".