elvish: github.com/elves/elvish/pkg/edit Index | Files | Directories

package edit

import "github.com/elves/elvish/pkg/edit"

Package edit implements the line editor for Elvish.

The line editor is based on the cli package, which implements a general, Elvish-agnostic line editor, and multiple "addon" packages. This package glues them together and provides Elvish bindings for them.


Package Files

binding_map.go buf_to_html.go builtins.go command_api.go complete_getopt.go completion.go config_api.go default_bindings.go editor.go highlight.go histwalk.go insert_api.go instant.go key_binding.go listing.go listing_custom.go minibuf.go navigation.go notifier.go prompt.go state_api.go store_api.go


var EmptyBindingMap = BindingMap{vals.EmptyMap}

type BindingMap Uses

type BindingMap struct {

BindingMap is a special Map that converts its key to ui.Key and ensures that its values satisfy eval.CallableValue.

func MakeBindingMap Uses

func MakeBindingMap(raw hashmap.Map) (BindingMap, error)

func (BindingMap) Assoc Uses

func (bt BindingMap) Assoc(k, v interface{}) (interface{}, error)

Assoc converts the index to ui.Key, ensures that the value is CallableValue, uses the Assoc of the inner Map and converts the result to a BindingTable.

func (BindingMap) Dissoc Uses

func (bt BindingMap) Dissoc(k interface{}) interface{}

Dissoc converts the key to ui.Key and calls the Dissoc method of the inner map.

func (BindingMap) GetKey Uses

func (bt BindingMap) GetKey(k ui.Key) eval.Callable

func (BindingMap) GetOrDefault Uses

func (bt BindingMap) GetOrDefault(k ui.Key) eval.Callable

func (BindingMap) HasKey Uses

func (bt BindingMap) HasKey(k interface{}) bool

func (BindingMap) Index Uses

func (bt BindingMap) Index(index interface{}) (interface{}, error)

Index converts the index to ui.Key and uses the Index of the inner Map.

func (BindingMap) Repr Uses

func (bt BindingMap) Repr(indent int) string

Repr returns the representation of the binding table as if it were an ordinary map keyed by strings.

type Editor Uses

type Editor struct {
    // contains filtered or unexported fields

Editor is the interface line editor for Elvish.

func NewEditor Uses

func NewEditor(tty cli.TTY, ev *eval.Evaler, st store.Store) *Editor

NewEditor creates a new editor from input and output terminal files.

func (*Editor) Ns Uses

func (ed *Editor) Ns() eval.Ns

Ns returns a namespace for manipulating the editor from Elvish code.

func (*Editor) ReadCode Uses

func (ed *Editor) ReadCode() (string, error)

ReadCode reads input from the user.


completePackage complete implements the code completion algorithm for Elvish.
highlightPackage highlight provides an Elvish syntax highlighter.

Package edit imports 43 packages (graph) and is imported by 1 packages. Updated 2020-02-22. Refresh now. Tools for package owners.