ratatui_toolkit/widgets/markdown_widget/state/cache_state/
render_cache.rs1use crate::widgets::markdown_widget::foundation::elements::CodeBlockTheme;
6use ratatui::text::Line;
7
8#[derive(Debug, Clone)]
10pub struct RenderCache {
11 pub content_hash: u64,
13 pub width: usize,
15 pub show_line_numbers: bool,
17 pub theme: CodeBlockTheme,
19 pub app_theme_hash: u64,
21 pub show_heading_collapse: bool,
23 pub lines: Vec<Line<'static>>,
25 pub line_boundaries: Vec<(usize, usize)>,
27}
28
29impl RenderCache {
30 #[allow(clippy::too_many_arguments)]
32 pub fn new(
33 content_hash: u64,
34 width: usize,
35 show_line_numbers: bool,
36 theme: CodeBlockTheme,
37 app_theme_hash: u64,
38 show_heading_collapse: bool,
39 lines: Vec<Line<'static>>,
40 line_boundaries: Vec<(usize, usize)>,
41 ) -> Self {
42 Self {
43 content_hash,
44 width,
45 show_line_numbers,
46 theme,
47 app_theme_hash,
48 show_heading_collapse,
49 lines,
50 line_boundaries,
51 }
52 }
53}