Documentation ¶
Index ¶
- Variables
- func NewCmdHistory(s ...string) storedefs.Store
- func NewSharedVar() *shared
- type CmdHistory
- func (history *CmdHistory) Add(cmd string) (int, error)
- func (history *CmdHistory) Cur() (int, error)
- func (history *CmdHistory) List(from, upto int) ([]string, error)
- func (history *CmdHistory) Next() (int, error)
- func (history *CmdHistory) One(seq int) (string, error)
- func (history *CmdHistory) Prev() (int, error)
- func (history *CmdHistory) RSearch(upto int, prefix string) (int, string, error)
- func (history *CmdHistory) Remove(seq int) error
- func (history *CmdHistory) Search(from int, prefix string) (int, string, error)
- func (history *CmdHistory) Seek(i int) (int, error)
- func (history *CmdHistory) Walk(from, upto int, f func(string) bool) error
- type Dir
- type DirHistory
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoVar = errors.New("no such variable")
ErrNoVar is returned by (*Store).GetSharedVar when there is no such variable.
Functions ¶
func NewCmdHistory ¶
func NewSharedVar ¶
func NewSharedVar() *shared
Types ¶
type CmdHistory ¶
The numbering is 1-based, not 0-based. Oh well.
func (*CmdHistory) Add ¶
func (history *CmdHistory) Add(cmd string) (int, error)
AddCmd adds a new command to the command history.
func (*CmdHistory) List ¶
func (history *CmdHistory) List(from, upto int) ([]string, error)
Cmds returns the contents of all commands within the specified range.
func (*CmdHistory) Next ¶
func (history *CmdHistory) Next() (int, error)
func (*CmdHistory) One ¶
func (history *CmdHistory) One(seq int) (string, error)
Cmd queries the command history item with the specified sequence number.
func (*CmdHistory) Prev ¶
func (history *CmdHistory) Prev() (int, error)
func (*CmdHistory) RSearch ¶
PrevCmd finds the last command before the given sequence number (exclusive) with the given prefix.
func (*CmdHistory) Remove ¶
func (history *CmdHistory) Remove(seq int) error
Remove removes a command from command history referenced by sequence.
type DirHistory ¶
func (*DirHistory) AddDir ¶
func (*DirHistory) AddDir(d string, incFactor float64) error
AddDir adds a directory to the directory history.
func (*DirHistory) AddDirRaw ¶
func (s *DirHistory) AddDirRaw(d string, score float64) error
AddDir adds a directory and its score to history.
func (*DirHistory) DelDir ¶
func (s *DirHistory) DelDir(d string) error
DelDir deletes a directory record from history.
Click to show internal directories.
Click to hide internal directories.