edit

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2021 License: BSD-2-Clause Imports: 46 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

View Source
var EmptyBindingMap = BindingMap{vals.EmptyMap}

Functions

This section is empty.

Types

type BindingMap

type BindingMap struct {
	hashmap.Map
}

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

func MakeBindingMap

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

func (BindingMap) Assoc

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

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

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

func (BindingMap) HasKey

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

func (BindingMap) Index

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

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

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

Editor is the interface line editor for Elvish.

func NewEditor

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

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

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

func (*Editor) ReadCode

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

ReadCode reads input from the user.

Directories

Path Synopsis
Package complete implements the code completion algorithm for Elvish.
Package complete implements the code completion algorithm for Elvish.
Package highlight provides an Elvish syntax highlighter.
Package highlight provides an Elvish syntax highlighter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL