forked from 1b-agent/opencadstudio-upstream
feat: add COMMANDLINEFADETIME sysvar for overlay history fade
Controls how long command-line history lines stay visible, in ms (0-60000, default 3000). Bare form stays active until a value or Esc.
This commit is contained in:
1 parent
b5eabae712
commit
0dab3ec54a
6 files changed
+150
-20
No files matched your search
@@ -243,6 +243,13 @@ pub struct UserSettings {
|
||||
/// are displayed above the command window (0–50, Registry, default 3).
|
||||
#[serde(default = "default_clipromptlines", deserialize_with = "deserialize_clipromptlines")]
|
||||
pub cliprompt_lines: i32,
|
||||
/// COMMANDLINEFADETIME: how long command-line overlay history lines stay
|
||||
/// visible, in milliseconds (0–60000, default 3000). 0 skips transient lines.
|
||||
#[serde(
|
||||
default = "default_commandline_fade_ms",
|
||||
deserialize_with = "deserialize_commandline_fade_ms"
|
||||
)]
|
||||
pub commandline_fade_ms: i32,
|
||||
/// Most-recently-inserted block names, most recent first, capped to 20.
|
||||
/// Used to rank INSERT suggestions without touching the drawing file.
|
||||
#[serde(default)]
|
||||
@@ -256,6 +263,22 @@ fn default_clipromptlines() -> i32 {
|
||||
3
|
||||
}
|
||||
|
||||
fn default_commandline_fade_ms() -> i32 {
|
||||
3000
|
||||
}
|
||||
|
||||
fn deserialize_commandline_fade_ms<'de, D>(de: D) -> Result<i32, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
let v = i32::deserialize(de).unwrap_or(3000);
|
||||
Ok(v.clamp(0, 60000))
|
||||
}
|
||||
|
||||
pub fn clamp_commandline_fade_ms(v: i32) -> i32 {
|
||||
v.clamp(0, 60000)
|
||||
}
|
||||
|
||||
fn default_dimension_continue_mode() -> i16 {
|
||||
1
|
||||
}
|
||||
@@ -312,6 +335,7 @@ impl Default for UserSettings {
|
||||
paper_bg_color: None,
|
||||
language: crate::i18n::Language::default(),
|
||||
cliprompt_lines: 3,
|
||||
commandline_fade_ms: 3000,
|
||||
block_mru: Vec::new(),
|
||||
block_freq: std::collections::HashMap::new(),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user