vendor: update github.com/peterh/liner
This commit is contained in:
15
vendor/github.com/peterh/liner/common.go
generated
vendored
15
vendor/github.com/peterh/liner/common.go
generated
vendored
@ -32,6 +32,7 @@ type commonState struct {
|
||||
cursorRows int
|
||||
maxRows int
|
||||
shouldRestart ShouldRestart
|
||||
needRefresh bool
|
||||
}
|
||||
|
||||
// TabStyle is used to select how tab completions are displayed.
|
||||
@ -58,7 +59,12 @@ var ErrPromptAborted = errors.New("prompt aborted")
|
||||
// platform is normally supported, but stdout has been redirected
|
||||
var ErrNotTerminalOutput = errors.New("standard output is not a terminal")
|
||||
|
||||
// Max elements to save on the killring
|
||||
// ErrInvalidPrompt is returned from Prompt or PasswordPrompt if the
|
||||
// prompt contains any unprintable runes (including substrings that could
|
||||
// be colour codes on some platforms).
|
||||
var ErrInvalidPrompt = errors.New("invalid prompt")
|
||||
|
||||
// KillRingMax is the max number of elements to save on the killring.
|
||||
const KillRingMax = 60
|
||||
|
||||
// HistoryLimit is the maximum number of entries saved in the scrollback history.
|
||||
@ -133,6 +139,13 @@ func (s *State) AppendHistory(item string) {
|
||||
}
|
||||
}
|
||||
|
||||
// ClearHistory clears the scroollback history.
|
||||
func (s *State) ClearHistory() {
|
||||
s.historyMutex.Lock()
|
||||
defer s.historyMutex.Unlock()
|
||||
s.history = nil
|
||||
}
|
||||
|
||||
// Returns the history lines starting with prefix
|
||||
func (s *State) getHistoryByPrefix(prefix string) (ph []string) {
|
||||
for _, h := range s.history {
|
||||
|
Reference in New Issue
Block a user