Documentation
¶
Index ¶
- Variables
- type Editor
- func (m *Editor) BindKey(key keys.Code, f readline.Command) error
- func (m *Editor) CmdBackwardChar(ctx context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) CmdBackwardDeleteChar(ctx context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) CmdDeleteChar(ctx context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) CmdForwardChar(ctx context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) CmdNextHistory(_ context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) CmdNextLine(ctx context.Context, rl *readline.Buffer) readline.Result
- func (m *Editor) CmdPreviousHistory(_ context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) CmdPreviousLine(ctx context.Context, rl *readline.Buffer) readline.Result
- func (m *Editor) CmdYank(_ context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) CursorLine() int
- func (m *Editor) GotoEndLine() func()
- func (m *Editor) Headline() int
- func (m *Editor) Lines() []string
- func (m *Editor) NewLine(_ context.Context, b *readline.Buffer) readline.Result
- func (m *Editor) NewPrefixCommand(prompt string) *PrefixCommand
- func (m *Editor) Out() *bufio.Writer
- func (m *Editor) PrintFromLine(i int) int
- func (m *Editor) Read(ctx context.Context) ([]string, error)
- func (m *Editor) SetColoring(c interface{})deprecated
- func (m *Editor) SetDefault(d []string)
- func (m *Editor) SetHistory(h readline.IHistory)
- func (m *Editor) SetHistoryCycling(value bool)
- func (m *Editor) SetMoveEnd(value bool)
- func (m *Editor) SetNextEditHook(f func(string) bool)
- func (m *Editor) SetPredictColor(colors [2]string)
- func (m *Editor) SetPrompt(f func(io.Writer, int) (int, error))
- func (m *Editor) SetTty(tty ttyadapter.Tty)
- func (m *Editor) SetWriter(w io.Writer)
- func (m *Editor) Submit(_ context.Context, B *readline.Buffer) readline.Result
- func (m *Editor) SubmitOnEnterWhen(f func([]string, int) bool)
- func (m *Editor) SwapEnter() errordeprecated
- func (m *Editor) Sync(line string)
- func (m *Editor) Writer() io.Writer
- type PrefixCommand
Constants ¶
This section is empty.
Variables ¶
View Source
var NewLineMarkForIncrementalSearch = "\u21B2 "
NewLineMarkForIncrementalSearch is the string used instead of "\n". This variable is not guaranteed to remain valid in the future.
Functions ¶
This section is empty.
Types ¶
type Editor ¶ added in v0.4.0
type Editor struct {
LineEditor readline.Editor
Dirty bool
StatusLineHeight int
Highlight []readline.Highlight
ResetColor string
DefaultColor string
OnAfterRender func(w io.Writer, availWidth int) // experimenal
// contains filtered or unexported fields
}
func (*Editor) CmdBackwardChar ¶ added in v0.11.2
func (*Editor) CmdBackwardDeleteChar ¶ added in v0.11.2
func (*Editor) CmdDeleteChar ¶ added in v0.11.2
func (*Editor) CmdForwardChar ¶ added in v0.11.2
func (*Editor) CmdNextHistory ¶ added in v0.11.2
func (*Editor) CmdNextLine ¶ added in v0.11.2
func (*Editor) CmdPreviousHistory ¶ added in v0.11.2
func (*Editor) CmdPreviousLine ¶ added in v0.11.2
func (*Editor) CursorLine ¶ added in v0.11.1
func (*Editor) GotoEndLine ¶ added in v0.11.1
func (m *Editor) GotoEndLine() func()
func (*Editor) NewPrefixCommand ¶ added in v0.18.1
func (m *Editor) NewPrefixCommand(prompt string) *PrefixCommand
func (*Editor) PrintFromLine ¶ added in v0.21.0
PrintFromLine prints lines[i:]. `headline` must be corrected. It does not fix view.
func (*Editor) SetColoring
deprecated
added in
v0.6.6
func (m *Editor) SetColoring(c interface{})
Deprecated: set LineEditor.Highlight instead
func (*Editor) SetDefault ¶ added in v0.9.0
func (*Editor) SetHistory ¶ added in v0.6.6
func (*Editor) SetHistoryCycling ¶ added in v0.6.7
func (*Editor) SetMoveEnd ¶ added in v0.9.0
func (*Editor) SetNextEditHook ¶ added in v0.21.0
func (*Editor) SetPredictColor ¶ added in v0.16.0
SetPredictColor enables the prediction of go-readline-ny v1.5.0 and specify the colors (e.g.) `m.SetPredictColor([...]string{"\x1B[3;22;34m", "\x1B[23;39m"})`
func (*Editor) SetTty ¶ added in v0.22.2
func (m *Editor) SetTty(tty ttyadapter.Tty)
func (*Editor) SubmitOnEnterWhen ¶ added in v0.12.0
SubmitOnEnterWhen defines the condition to submit when Enter-key is pressed.
type PrefixCommand ¶ added in v0.11.1
func (*PrefixCommand) String ¶ added in v0.11.1
func (*PrefixCommand) String() string
Click to show internal directories.
Click to hide internal directories.
