prompt

package
v0.0.0-...-b77b3d7 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2018 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package prompt implements prompt-related functionalities of the editor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromptInit

func PromptInit() eval.Callable

PromptInit returns an initial value for $edit:prompt.

func RpromptInit

func RpromptInit() eval.Callable

RpromptInit returns an initial value for $edit:rprompt.

Types

type Config

type Config struct {
	Prompt  eval.Callable
	Rprompt eval.Callable

	RpromptPersistent bool
	PromptsMaxWait    float64
}

func (*Config) MakeMaxWaitChan

func (cfg *Config) MakeMaxWaitChan() <-chan time.Time

MakeMaxWait makes a channel that sends the current time after $edit:-prompts-max-wait seconds if the time fits in a time.Duration value, or nil otherwise.

type Editor

type Editor interface {
	Evaler() *eval.Evaler
	Notify(string, ...interface{})
}

Editor is the interface used by the prompt to access the editor.

type Updater

type Updater struct {
	Staled []*ui.Styled
	// contains filtered or unexported fields
}

Updater manages the update of a prompt.

func NewUpdater

func NewUpdater(promptFn eval.Callable) *Updater

NewUpdater creates a new Updater.

func (*Updater) Update

func (pu *Updater) Update(ed Editor) <-chan []*ui.Styled

Update updates the prompt, returning a channel onto which the result will be written.

Jump to

Keyboard shortcuts

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