history

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 4 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) Load

func (h *History) Load(file string) (err error)

Load read persistence data from file

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.

func (*History) Rebuild

func (h *History) Rebuild(buf string, force bool)

func (*History) Remove added in v0.0.2

func (h *History) Remove(input string)

func (*History) Reset

func (h *History) Reset()

func (*History) Save

func (h *History) Save(file string) (err error)

Save save data persistence to file

Jump to

Keyboard shortcuts

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