pub struct MicroscopeState {Show 19 fields
pub active: bool,
pub query: String,
pub cursor_pos: usize,
pub all_items: Vec<MicroscopeItem>,
pub items: Vec<MicroscopeItem>,
pub selected_index: usize,
pub scroll_offset: usize,
pub picker_name: String,
pub title: String,
pub prompt: String,
pub preview: Option<PreviewContent>,
pub layout: MicroscopeLayout,
pub preview_enabled: bool,
pub prompt_mode: PromptMode,
pub loading_state: LoadingState,
pub bounds: LayoutBounds,
pub layout_config: LayoutConfig,
pub total_count: u32,
pub matched_count: u32,
}Expand description
State of the microscope fuzzy finder
Fields§
§active: boolWhether microscope is currently active/visible
query: StringCurrent search query
cursor_pos: usizeCursor position in the query
all_items: Vec<MicroscopeItem>All items from the picker (unfiltered)
items: Vec<MicroscopeItem>Current list of items (filtered/sorted)
selected_index: usizeCurrently selected item index
scroll_offset: usizeScroll offset for long lists
picker_name: StringName of the current picker
title: StringTitle to display
prompt: StringPrompt string
preview: Option<PreviewContent>Preview content (if available)
layout: MicroscopeLayoutLegacy layout configuration (for compatibility)
preview_enabled: boolWhether preview is enabled
prompt_mode: PromptModePrompt mode (Insert/Normal)
loading_state: LoadingStateLoading state
bounds: LayoutBoundsHelix-style layout bounds
layout_config: LayoutConfigLayout configuration
total_count: u32Total item count (from matcher)
matched_count: u32Matched item count (from matcher)
Implementations§
Source§impl MicroscopeState
impl MicroscopeState
Sourcepub fn open(&mut self, picker_name: &str, title: &str, prompt: &str)
pub fn open(&mut self, picker_name: &str, title: &str, prompt: &str)
Open microscope with a picker
Starts in Normal mode for j/k navigation. Press ‘i’ to enter Insert mode.
Sourcepub fn enter_insert(&mut self)
pub fn enter_insert(&mut self)
Enter insert mode
Sourcepub fn enter_normal(&mut self)
pub fn enter_normal(&mut self)
Enter normal mode
Sourcepub fn toggle_mode(&mut self)
pub fn toggle_mode(&mut self)
Toggle between insert and normal mode
Sourcepub fn set_loading(&mut self, state: LoadingState)
pub fn set_loading(&mut self, state: LoadingState)
Set loading state
Sourcepub fn update_bounds(&mut self, screen_width: u16, screen_height: u16)
pub fn update_bounds(&mut self, screen_width: u16, screen_height: u16)
Update bounds from screen dimensions
Sourcepub fn status_text(&self) -> String
pub fn status_text(&self) -> String
Get status line text
Sourcepub fn update_items(&mut self, items: Vec<MicroscopeItem>)
pub fn update_items(&mut self, items: Vec<MicroscopeItem>)
Update items from search results (initial load - stores in both all_items and items)
Sourcepub fn update_filtered_items(&mut self, items: Vec<MicroscopeItem>)
pub fn update_filtered_items(&mut self, items: Vec<MicroscopeItem>)
Update filtered items only (for filtering - keeps all_items unchanged)
Sourcepub fn insert_char(&mut self, c: char)
pub fn insert_char(&mut self, c: char)
Insert a character at cursor position
Sourcepub fn delete_char(&mut self)
pub fn delete_char(&mut self)
Delete character before cursor
Sourcepub fn cursor_left(&mut self)
pub fn cursor_left(&mut self)
Move cursor left
Sourcepub fn cursor_right(&mut self)
pub fn cursor_right(&mut self)
Move cursor right
Sourcepub const fn cursor_home(&mut self)
pub const fn cursor_home(&mut self)
Move cursor to start
Sourcepub fn cursor_end(&mut self)
pub fn cursor_end(&mut self)
Move cursor to end
Sourcepub fn word_forward(&mut self)
pub fn word_forward(&mut self)
Move cursor forward one word
Sourcepub fn word_backward(&mut self)
pub fn word_backward(&mut self)
Move cursor backward one word
Sourcepub fn clear_query(&mut self)
pub fn clear_query(&mut self)
Clear the query
Sourcepub fn delete_word(&mut self)
pub fn delete_word(&mut self)
Delete word before cursor
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Select next item
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Select previous item
Sourcepub fn move_to_first(&mut self)
pub fn move_to_first(&mut self)
Move to first item
Sourcepub fn move_to_last(&mut self)
pub fn move_to_last(&mut self)
Move to last item
Sourcepub fn selected_item(&self) -> Option<&MicroscopeItem>
pub fn selected_item(&self) -> Option<&MicroscopeItem>
Get currently selected item
Sourcepub const fn is_visible(&self) -> bool
pub const fn is_visible(&self) -> bool
Check if microscope is active and visible
Sourcepub fn visible_items(&self) -> &[MicroscopeItem]
pub fn visible_items(&self) -> &[MicroscopeItem]
Get visible items slice
Sourcepub fn set_preview(&mut self, content: Option<PreviewContent>)
pub fn set_preview(&mut self, content: Option<PreviewContent>)
Update preview content
Sourcepub fn calculate_layout(&mut self, screen_width: u16, screen_height: u16)
pub fn calculate_layout(&mut self, screen_width: u16, screen_height: u16)
Calculate layout based on screen dimensions
Trait Implementations§
Source§impl Clone for MicroscopeState
impl Clone for MicroscopeState
Source§fn clone(&self) -> MicroscopeState
fn clone(&self) -> MicroscopeState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MicroscopeState
impl Debug for MicroscopeState
Source§impl Default for MicroscopeState
impl Default for MicroscopeState
Source§fn default() -> MicroscopeState
fn default() -> MicroscopeState
Auto Trait Implementations§
impl Freeze for MicroscopeState
impl RefUnwindSafe for MicroscopeState
impl Send for MicroscopeState
impl Sync for MicroscopeState
impl Unpin for MicroscopeState
impl UnwindSafe for MicroscopeState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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