package edit

import "src.elv.sh/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.

Index

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 hist_store.go histwalk.go insert_api.go instant.go key_binding.go listing.go listing_custom.go minibuf.go navigation.go ns_helper.go prompt.go state_api.go store_api.go vars.go

type Editor

type Editor struct {
    // contains filtered or unexported fields
}

Editor is the interactive line editor for Elvish.

func NewEditor

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

NewEditor creates a new editor. The TTY is used for input and output. The Evaler is used for syntax highlighting, completion, and calling callbacks. The Store is used for saving and retrieving command and directory history.

func (*Editor) Ns

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

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

See https://elv.sh/ref/edit.html for the Elvish API.

func (*Editor) ReadCode

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

ReadCode reads input from the user.

Directories

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

Package edit imports 39 packages (graph) and is imported by 1 packages. Updated now.

.
Tools for package owners.