linehistory

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type History

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

History stores the texts that are entered.

func NewHistory

func NewHistory() *History

NewHistory returns new history object.

func (*History) Add

func (h *History) Add(input string)

Add to add text in history.

func (*History) Clear

func (h *History) Clear()

Clear to clear the history.

func (*History) Dump

func (h *History) Dump() string

Dump return all history entries as string

func (*History) Newer

func (h *History) Newer(buf string) (new string, changed bool)

Newer saves a buffer of current line and get a buffer of next line by up-arrow. The changes of line buffers are stored until new history is created.

func (*History) Older

func (h *History) Older(buf string) (new string, changed bool)

Older saves a buffer of current line and get a buffer of previous line by up-arrow. The changes of line buffers are stored until new history is created.

Jump to

Keyboard shortcuts

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