Try to optimize

This commit is contained in:
2026-01-29 11:53:47 +01:00
parent 73db616139
commit 495bfb3bdc
14 changed files with 764 additions and 214 deletions

View File

@@ -1,3 +1,4 @@
use std::cell::RefCell;
use std::ops::RangeInclusive;
use cagire_ratatui::Editor;
@@ -55,6 +56,14 @@ pub struct EditorContext {
pub selection_anchor: Option<usize>,
pub copied_steps: Option<CopiedSteps>,
pub show_stack: bool,
pub stack_cache: RefCell<Option<StackCache>>,
}
#[derive(Clone)]
pub struct StackCache {
pub cursor_line: usize,
pub lines_hash: u64,
pub result: String,
}
#[derive(Clone)]
@@ -96,6 +105,7 @@ impl Default for EditorContext {
selection_anchor: None,
copied_steps: None,
show_stack: false,
stack_cache: RefCell::new(None),
}
}
}

View File

@@ -13,7 +13,7 @@ pub mod ui;
pub use audio::{AudioSettings, DeviceKind, EngineSection, Metrics, SettingKind};
pub use options::{OptionsFocus, OptionsState};
pub use editor::{CopiedStepData, CopiedSteps, EditorContext, Focus, PatternField, PatternPropsField};
pub use editor::{CopiedStepData, CopiedSteps, EditorContext, Focus, PatternField, PatternPropsField, StackCache};
pub use live_keys::LiveKeyState;
pub use modal::Modal;
pub use panel::{PanelFocus, PanelState, SidePanel};