Documentation ¶
Overview ¶
Package edit implements a command line editor.
Index ¶
Constants ¶
View Source
const ( S_IWOTH = 0x2 // Writable by other S_IXGRP = 0x8 // Executable by group S_IXOTH = 0x1 // Executable by other )
Weirdly, permission masks for group and other are missing on platforms other than linux, darwin and netbsd. So we replicate some of them here.
View Source
const FileBufferSize = 64 * 1024
Variables ¶
View Source
var ( ErrCompleterMustBeFn = errors.New("completer must be fn") ErrCompleterArgMustBeString = errors.New("arguments to arg completers must be string") ErrTooFewArguments = errors.New("too few arguments") )
View Source
var ( ErrNotRegular = errors.New("no preview for non-regular file") ErrNotValidUTF8 = errors.New("no preview for non-utf8 file") )
View Source
var ErrEditorInactive = errors.New("editor inactive")
View Source
var ErrStoreOffline = errors.New("store offline")
View Source
var Logger = util.GetLogger("[edit] ")
Functions ¶
This section is empty.
Types ¶
type BindingTable ¶
type BindingTable struct {
// contains filtered or unexported fields
}
BindingTable adapts a binding table to eval.IndexSetter, so that it can be manipulated in elvish script.
func (BindingTable) IndexSet ¶
func (bt BindingTable) IndexSet(idx, v eval.Value)
func (BindingTable) Kind ¶
func (BindingTable) Kind() string
func (BindingTable) Repr ¶
func (bt BindingTable) Repr(indent int) string
type BuiltinFn ¶ added in v0.4.0
type BuiltinFn struct {
// contains filtered or unexported fields
}
BuiltinFn records an editor builtin.
type CursorOnModeLiner ¶ added in v0.6.0
type CursorOnModeLiner interface {
CursorOnModeLine() bool
}
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor keeps the status of the line editor.
func (*Editor) ActiveMutex ¶ added in v0.4.0
func (*Editor) CallFn ¶ added in v0.3.0
func (ed *Editor) CallFn(fn eval.CallableValue, args ...eval.Value)
CallFn calls an Fn, displaying its outputs and possible errors as editor notifications. It is the preferred way to call a Fn while the editor is active.
type Highlighter ¶ added in v0.6.0
type Highlighter struct {
// contains filtered or unexported fields
}
type ListRenderer ¶ added in v0.6.0
type ListRenderer interface { // ListRender renders the listing under the given constraint of width and maximum // height. It returns a rendered buffer. ListRender(width, maxHeight int) *buffer }
ListRenderer is a mode with a listing.
type Lister ¶
type Lister interface {
List(maxHeight int) renderer
}
Lister is a mode with a listing.
type Placeholderer ¶ added in v0.2.0
type Placeholderer interface {
Placeholder() string
}
Notes ¶
Bugs ¶
buffer.write drops ASCII control characters silently
Source Files ¶
- action.go
- arg-completers.go
- bang.go
- binding.go
- buffer.go
- builtin-fn.go
- call.go
- candidate.go
- compl-getopt.go
- completers.go
- completion.go
- distribute-width.go
- editor.go
- highlight.go
- histlist.go
- history-value.go
- history.go
- insert.go
- listing.go
- location.go
- ls-colors.go
- minmax.go
- mode.go
- module.go
- navigation.go
- nodeutil.go
- prompt.go
- render.go
- style.go
- styled.go
- styling.go
- writer.go
Click to show internal directories.
Click to hide internal directories.