class HistoryFilter
extends DelegateFilter

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.

Constructors

HistoryFilter ( history: () => IndexedSeq [ String ] , commentStartColor: String , commentEndColor: String )

Members

[+] private val commentEndColor : String
[+] private val commentStartColor : String
[+] val dropHistoryChars : Set [ Int ]
[+] private val history : () => IndexedSeq [ String ]
[+] var historyIndex : Int

-1 means we haven't started looking at history, n >= 0 means we're currently at history command n

-1 means we haven't started looking at history, n >= 0 means we're currently at history command n

[+] var prevBuffer : Option [ Vector [ Char ] ]

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 filt...

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

[+] var searchTerm : Option [ Vector [ Char ] ]

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

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
[+] def activeHistory : Boolean
[+] def activeSearch : Boolean
[+] def backspace ( b: Vector [ Char ] , c: Int ) : ( Vector [ A ], Int, String )
[+] def ctrlR ( b: Vector [ Char ] , c: Int ) : ( Vector [ A ], Int, String )
[+] def down ( b: Vector [ Char ] , c: Int ) : ( Vector [ A ], Int, String )
[+] def endHistory ( ) : Unit
[+] def filter : Filter
[+] def filter0 : Filter
[+] def historyIndex_= ( x$1: Int ) : Unit

-1 means we haven't started looking at history, n >= 0 means we're currently at history command n

-1 means we haven't started looking at history, n >= 0 means we're currently at history command n

[+] def identifier : String

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 t...

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.

[+] def prelude : Filter
[+] def prevBuffer_= ( x$1: Option [ Vector [ Char ] ] ) : Unit

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 filt...

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

[+] def printableChar ( char: Char ) ( b: Vector [ Char ] , c: Int ) : ( Vector [ A ], Int, String )
[+] def searchHistory ( start: Int , increment: Int , buffer: Vector [ Char ] , skipped: Vector [ Char ] ) : ( Vector [ A ], Int, String )
[+] def searchOrHistoryAnd ( cond: Boolean ) : Boolean

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 k...

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.

[+] def searchTerm_= ( x$1: Option [ Vector [ Char ] ] ) : Unit

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

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
[+] def startHistory ( b: Vector [ Char ] , c: Int ) : ( Vector [ Char ], Int, String )

Kicks the HistoryFilter from passive-mode into search-history mode

Kicks the HistoryFilter from passive-mode into search-history mode

[+] def up ( b: Vector [ Char ] , c: Int ) : ( Vector [ A ], Int, String )
[+] def wrap ( rest: LazyList [ Int ] , out: ( Vector [ Char ], Int, String ) ) : TermState