pub struct SearchBank {
pub last: Option<String>,
pub forward: bool,
pub history: Vec<String>,
pub history_cursor: Option<usize>,
}Expand description
Session-global search state: the last committed //? pattern, its
direction, and the search-prompt history. Shared across every window’s
Editor via Arc<Mutex<SearchBank>> — see Editor::set_search_arc.
Bundled into one struct behind a single lock (rather than four separate
Arc<Mutex<_>> fields) because vim always reads/writes these four
together — e.g. committing a search sets both last and forward in
the same breath, and n/N reads both. Mirrors GlobalMarks /
crate::Registers as the app host’s spelling for the shared-bank type.
Fields§
§last: Option<String>Last committed search pattern, for n / N (or Find Next).
forward: boolDirection of the last committed search: true = forward (/),
false = backward (?).
history: Vec<String>Search history, oldest first. Capped at
crate::types::SEARCH_HISTORY_MAX entries.
history_cursor: Option<usize>Cursor while walking search history with Up/Down (Ctrl-P/Ctrl-N).
Trait Implementations§
Source§impl Clone for SearchBank
impl Clone for SearchBank
Source§fn clone(&self) -> SearchBank
fn clone(&self) -> SearchBank
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more