pub struct VimSearchAdapter { /* private fields */ }Expand description
Adapter that connects VimSearchManager to the state dispatcher
Implementations§
Source§impl VimSearchAdapter
impl VimSearchAdapter
pub fn new() -> Self
Sourcepub fn with_manager(manager: VimSearchManager) -> Self
pub fn with_manager(manager: VimSearchManager) -> Self
Create with a specific manager (for testing or advanced use)
Sourcepub fn should_handle_key(&self, state: &AppStateContainer) -> bool
pub fn should_handle_key(&self, state: &AppStateContainer) -> bool
Check if vim search should handle a key based on AppStateContainer state
Sourcepub fn should_handle_key_buffer(&self, buffer: &dyn BufferAPI) -> bool
pub fn should_handle_key_buffer(&self, buffer: &dyn BufferAPI) -> bool
Check if vim search should handle a key based on Buffer state (legacy - for compatibility)
Sourcepub fn manager(&self) -> &VimSearchManager
pub fn manager(&self) -> &VimSearchManager
Get the inner manager
Sourcepub fn manager_mut(&mut self) -> &mut VimSearchManager
pub fn manager_mut(&mut self) -> &mut VimSearchManager
Get mutable reference to inner manager
Sourcepub fn handle_key(
&mut self,
key: KeyCode,
state: &mut AppStateContainer,
) -> bool
pub fn handle_key( &mut self, key: KeyCode, state: &mut AppStateContainer, ) -> bool
Handle a key press through AppStateContainer (simplified interface)
Returns true if key was handled, false to let it fall through
Sourcepub fn handle_key_legacy(
&mut self,
key: KeyCode,
dataview: &DataView,
viewport: &mut ViewportManager,
buffer: &dyn BufferAPI,
) -> bool
pub fn handle_key_legacy( &mut self, key: KeyCode, dataview: &DataView, viewport: &mut ViewportManager, buffer: &dyn BufferAPI, ) -> bool
Handle a key press - delegates to VimSearchManager if appropriate (legacy)
Sourcepub fn start_search(&mut self)
pub fn start_search(&mut self)
Start a new search
Sourcepub fn update_pattern(
&mut self,
pattern: String,
dataview: &DataView,
viewport: &mut ViewportManager,
)
pub fn update_pattern( &mut self, pattern: String, dataview: &DataView, viewport: &mut ViewportManager, )
Update search pattern and find matches
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 the current search
Check if we’re currently navigating through search results
Sourcepub fn get_pattern(&self) -> Option<String>
pub fn get_pattern(&self) -> Option<String>
Get the current search pattern
Sourcepub fn get_match_info(&self) -> Option<(usize, usize)>
pub fn get_match_info(&self) -> Option<(usize, usize)>
Get match information (current, total)
Sourcepub fn cancel_search(&mut self)
pub fn cancel_search(&mut self)
Cancel the current search
Exit navigation mode
Sourcepub fn mark_search_complete(&mut self)
pub fn mark_search_complete(&mut self)
Mark search as complete (after Apply/Enter) Keeps matches for n/N navigation and stays active
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
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
Sourcepub fn set_search_state_from_external(
&mut self,
pattern: String,
matches: Vec<(usize, usize)>,
dataview: &DataView,
)
pub fn set_search_state_from_external( &mut self, pattern: String, matches: Vec<(usize, usize)>, dataview: &DataView, )
Set search state from external source (for compatibility)
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 the last search
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 the first match
Trait Implementations§
Source§impl Default for VimSearchAdapter
impl Default for VimSearchAdapter
Source§impl StateSubscriber for VimSearchAdapter
impl StateSubscriber for VimSearchAdapter
Source§fn on_state_event(&mut self, event: &StateEvent, buffer: &Buffer)
fn on_state_event(&mut self, event: &StateEvent, buffer: &Buffer)
Auto Trait Implementations§
impl Freeze for VimSearchAdapter
impl RefUnwindSafe for VimSearchAdapter
impl Send for VimSearchAdapter
impl Sync for VimSearchAdapter
impl Unpin for VimSearchAdapter
impl UnsafeUnpin for VimSearchAdapter
impl UnwindSafe for VimSearchAdapter
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
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>
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>
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