Documentation ¶
Overview ¶
Package edit implements a command line editor.
Index ¶
Constants ¶
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.
const FileBufferSize = 64 * 1024
Variables ¶
var ( ErrCompleterMustBeFn = errors.New("completer must be fn") ErrCompleterArgMustBeString = errors.New("arguments to arg completers must be string") ErrTooFewArguments = errors.New("too few arguments") )
var ( ErrNotRegular = errors.New("no preview for non-regular file") ErrNotValidUTF8 = errors.New("no preview for non-utf8 file") )
var ErrStoreOffline = errors.New("store offline")
var PinnedScore = math.Inf(1)
PinnedScore is a special value of Score in store.Dir to represent that the directory is pinned.
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 NewEditor ¶
func NewEditor(in *os.File, out *os.File, sigs chan os.Signal, ev *eval.Evaler, st *store.Store) *Editor
NewEditor creates an 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 ¶
after calling extendRight, the widths of some lines can exceed b.width.
Source Files ¶
- abbr.go
- action.go
- api-utils.go
- api.go
- arg-completers.go
- bang.go
- binding.go
- buffer.go
- candidate.go
- compl-getopt.go
- completers.go
- completion.go
- distribute-width.go
- editor.go
- highlight.go
- histlist.go
- history-value.go
- history.go
- hooks.go
- insert.go
- listing.go
- location.go
- ls-colors.go
- ls-colors_string.go
- matcher.go
- minmax.go
- mode.go
- navigation.go
- nodeutil.go
- prompt.go
- raw-insert.go
- registry.go
- render.go
- style.go
- styled.go
- styling.go
- writer.go