-1
means we haven't started looking at history, n >= 0
means we're
currently at history command n
the .toString
of this object, except by making it separate we force
the implementer to provide something and stop them from accidentally
leaving it as the meaningless default.
the .toString
of this object, except by making it separate we force
the implementer to provide something and stop them from accidentally
leaving it as the meaningless default.
Records the last buffer that the filter has observed while it's in search/history mode.
Records the last buffer that the filter has observed while it's in search/history mode. If the new buffer differs from this, assume that some other filter modified the buffer and drop out of search/history
Predicate to check if either we're searching for a term or if we're in history-browsing mode and some predicate is true.
Predicate to check if either we're searching for a term or if we're in history-browsing mode and some predicate is true.
Very often we want to capture keystrokes in search-mode more aggressively than in history-mode, e.g. search-mode drops you out more aggressively than history-mode does, and its up/down keys cycle through history more aggressively on every keystroke while history-mode only cycles when you reach the top/bottom line of the multi-line input.
The term we're searching for, if any.
The term we're searching for, if any.
- None
means we're not searching for anything, e.g. we're just
browsing history
- Some(term)
where term
is not empty is what it normally looks
like when we're searching for something
- Some(term)
where term
is empty only really happens when you
start searching and delete things, or if you Ctrl-R
on an empty
prompt
Kicks the HistoryFilter from passive-mode into search-history mode
Provides history navigation up and down, saving the current line, a well as history-search functionality (
Ctrl R
in bash) letting you quickly find & filter previous commands by entering a sub-string.