ratatui_toolkit/widgets/markdown_widget/state/scroll_state/mod.rs
1//! Scroll state for markdown widget.
2//!
3//! Manages scroll offset, viewport dimensions, and current line position.
4//! This module handles ONLY scrolling - nothing else.
5
6pub mod constructors;
7pub mod methods;
8pub mod traits;
9
10pub use constructors::*;
11pub use methods::*;
12pub use traits::*;
13
14/// Scroll state for markdown rendering.
15///
16/// Manages scroll position, viewport dimensions, and current line for navigation.
17#[derive(Debug, Clone)]
18pub struct ScrollState {
19 /// Current scroll offset (0-indexed, first visible line index).
20 pub scroll_offset: usize,
21 /// Height of viewport (number of visible lines).
22 pub viewport_height: usize,
23 /// Total number of lines in document.
24 pub total_lines: usize,
25 /// Currently selected line (1-indexed, for highlighting).
26 pub current_line: usize,
27 /// Current filter text (when in filter mode).
28 pub filter: Option<String>,
29 /// Whether filter mode is currently active.
30 pub filter_mode: bool,
31}