pub struct VimSearchManager { /* private fields */ }
Expand description
Manages vim-like forward search behavior
Implementations§
Source§impl VimSearchManager
impl VimSearchManager
pub fn new() -> Self
Sourcepub fn start_search(&mut self)
pub fn start_search(&mut self)
Start search mode (when / is pressed)
Sourcepub fn update_pattern(
&mut self,
pattern: String,
dataview: &DataView,
viewport: &mut ViewportManager,
) -> Option<SearchMatch>
pub fn update_pattern( &mut self, pattern: String, dataview: &DataView, viewport: &mut ViewportManager, ) -> Option<SearchMatch>
Update search pattern and find first match dynamically
Sourcepub fn confirm_search(
&mut self,
dataview: &DataView,
viewport: &mut ViewportManager,
) -> bool
pub fn confirm_search( &mut self, dataview: &DataView, viewport: &mut ViewportManager, ) -> bool
Confirm search (when Enter is pressed) - enter navigation mode
Sourcepub fn next_match(
&mut self,
viewport: &mut ViewportManager,
) -> Option<SearchMatch>
pub fn next_match( &mut self, viewport: &mut ViewportManager, ) -> Option<SearchMatch>
Navigate to next match (n key)
Sourcepub fn previous_match(
&mut self,
viewport: &mut ViewportManager,
) -> Option<SearchMatch>
pub fn previous_match( &mut self, viewport: &mut ViewportManager, ) -> Option<SearchMatch>
Navigate to previous match (N key)
Sourcepub fn cancel_search(&mut self)
pub fn cancel_search(&mut self)
Cancel search and return to normal mode
Exit navigation mode but keep search pattern for later
Sourcepub fn resume_last_search(
&mut self,
dataview: &DataView,
viewport: &mut ViewportManager,
) -> bool
pub fn resume_last_search( &mut self, dataview: &DataView, viewport: &mut ViewportManager, ) -> bool
Resume search with last pattern (for repeating search with /)
Check if in navigation mode
Sourcepub fn get_pattern(&self) -> Option<String>
pub fn get_pattern(&self) -> Option<String>
Get current pattern
Sourcepub fn get_match_info(&self) -> Option<(usize, usize)>
pub fn get_match_info(&self) -> Option<(usize, usize)>
Get current match info for status display
Sourcepub fn reset_to_first_match(
&mut self,
viewport: &mut ViewportManager,
) -> Option<SearchMatch>
pub fn reset_to_first_match( &mut self, viewport: &mut ViewportManager, ) -> Option<SearchMatch>
Reset to first match (for ‘g’ key)
Sourcepub fn set_case_sensitive(&mut self, case_sensitive: bool)
pub fn set_case_sensitive(&mut self, case_sensitive: bool)
Set case sensitivity for search
Auto Trait Implementations§
impl Freeze for VimSearchManager
impl RefUnwindSafe for VimSearchManager
impl Send for VimSearchManager
impl Sync for VimSearchManager
impl Unpin for VimSearchManager
impl UnwindSafe for VimSearchManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more