reovim_plugin_microscope/microscope/
mod.rs

1//! Microscope - Fuzzy finder module
2//!
3//! This module provides a Microscope-like fuzzy finder system with:
4//! - Trait-based picker system for extensibility
5//! - Nucleo-powered streaming fuzzy matching
6//! - Helix-style bottom-anchored layout with preview
7//! - Modal editing (Normal/Insert modes) in prompt
8//! - Multiple built-in pickers (files, buffers, grep, etc.)
9//!
10//! # Streaming Architecture
11//!
12//! The matcher uses nucleo's `Nucleo<T>` API for non-blocking fuzzy matching:
13//! - Items are pushed via `Injector` from background tasks
14//! - `tick()` processes matches without blocking input
15//! - `snapshot()` retrieves current results instantly
16//!
17//! # Helix-Style Layout
18//!
19//! ```text
20//! +---------------------------------------------------------------+
21//! |                      Editor Content                            |
22//! +------------------ y = screen_height - picker_height -----------+
23//! | Results (40%)                    | Preview (60%)               |
24//! +----------------------------------+------------------------------+
25//! | status: 4/128 files                    <CR> Open | <Esc> Close |
26//! +---------------------------------------------------------------+
27//! ```
28
29pub mod item;
30pub mod layout;
31pub mod matcher;
32pub mod picker;
33pub mod state;
34
35pub use {
36    item::{MicroscopeData, MicroscopeItem},
37    layout::{LayoutBounds, LayoutConfig, PanelBounds, calculate_layout, visible_item_count},
38    matcher::{MatcherItem, MatcherStatus, MicroscopeMatcher, push_item, push_items},
39    picker::{BufferInfo, MicroscopeAction, Picker, PickerContext, PickerRegistry},
40    state::{
41        LoadingState, MicroscopeLayout, MicroscopeState, PreviewContent, PromptMode, StyledSpan,
42    },
43};