edit

package
v0.0.0-...-91dc524 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: BSD-2-Clause Imports: 39 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

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor struct {

	// Maybe move this to another type that represents the REPL cycle as a whole, not just the
	// read/edit portion represented by the Editor type.
	AfterCommand []func(src parse.Source, duration float64, err error)
	// contains filtered or unexported fields
}

Editor is the interactive line editor for Elvish.

func NewEditor

func NewEditor(tty cli.TTY, ev *eval.Evaler, st storedefs.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) Notify

func (ed *Editor) Notify(note ui.Text)

Notify adds a note to the notification buffer.

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.

func (*Editor) RunAfterCommandHooks

func (ed *Editor) RunAfterCommandHooks(src parse.Source, duration float64, err error)

RunAfterCommandHooks runs callbacks involving the interactive completion of a command line.

Directories

Path Synopsis
Package complete implements the code completion algorithm for Elvish.
Package complete implements the code completion algorithm for Elvish.
Package filter implements the Elvish filter DSL.
Package filter implements the Elvish filter DSL.
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