history

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type History

type History struct {
	Max   int
	Data  []string
	Index int
	// contains filtered or unexported fields
}

History struct

func New

func New() *History

New history struct

func (*History) Add

func (h *History) Add(line string)

Add line to history

func (*History) Current

func (h *History) Current()

Current history line

func (*History) Empty

func (h *History) Empty() bool

Empty history

func (*History) Get

func (h *History) Get(index int) string

Get history at index

func (*History) HasLine added in v0.9.2

func (h *History) HasLine(line string) bool

HasLine will check is the history buffer contains the given string

func (*History) Next

func (h *History) Next() string

Next returns the history line after the current index

func (*History) Prev

func (h *History) Prev() string

Prev returns the previous history line fvrom the current index

Jump to

Keyboard shortcuts

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