pub struct SearchState {
pub direction: Direction,
pub history_index: Option<usize>,
display_offset_delta: i32,
origin: Point,
focused_match: Option<Match>,
history: VecDeque<String>,
dfas: Option<RegexSearch>,
}
Expand description
Regex search state.
Fields§
§direction: Direction
Search direction.
history_index: Option<usize>
Current position in the search history.
display_offset_delta: i32
Change in display offset since the beginning of the search.
origin: Point
Search origin in viewport coordinates relative to original display offset.
focused_match: Option<Match>
Focused match during active search.
history: VecDeque<String>
Search regex and history.
During an active search, the first element is the user’s current input.
While going through history, the SearchState::history_index
will point to the element
in history which is currently being previewed.
dfas: Option<RegexSearch>
Compiled search automatons.
Implementations§
source§impl SearchState
impl SearchState
sourcepub fn focused_match(&self) -> Option<&Match>
pub fn focused_match(&self) -> Option<&Match>
Focused match during vi-less search.
sourcepub fn clear_focused_match(&mut self)
pub fn clear_focused_match(&mut self)
Clear the focused match.
sourcepub fn dfas(&mut self) -> Option<&mut RegexSearch>
pub fn dfas(&mut self) -> Option<&mut RegexSearch>
Active search dfas.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SearchState
impl RefUnwindSafe for SearchState
impl Send for SearchState
impl Sync for SearchState
impl Unpin for SearchState
impl UnwindSafe for SearchState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.