repl_settings.rs

 1use gpui::App;
 2use settings::Settings;
 3
 4/// Settings for configuring REPL display and behavior.
 5#[derive(Clone, Debug)]
 6pub struct ReplSettings {
 7    /// Maximum number of lines to keep in REPL's scrollback buffer.
 8    /// Clamped with [4, 256] range.
 9    ///
10    /// Default: 32
11    pub max_lines: usize,
12    /// Maximum number of columns to keep in REPL's scrollback buffer.
13    /// Clamped with [20, 512] range.
14    ///
15    /// Default: 128
16    pub max_columns: usize,
17}
18
19impl Settings for ReplSettings {
20    fn from_settings(content: &settings::SettingsContent, _cx: &mut App) -> Self {
21        let repl = content.repl.as_ref().unwrap();
22
23        Self {
24            max_lines: repl.max_lines.unwrap(),
25            max_columns: repl.max_columns.unwrap(),
26        }
27    }
28}