Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

settings: Fix inconsistent terminal font weight step size (#44243)

Mayank Vermaf4b8b0f4716d
diff --git a/crates/settings/src/settings_content/terminal.rs b/crates/settings/src/settings_content/terminal.rs
index cd01eb14fa5..1a30eecaa12 100644
--- a/crates/settings/src/settings_content/terminal.rs
+++ b/crates/settings/src/settings_content/terminal.rs
@@ -1,7 +1,7 @@
use std::path::PathBuf;
use collections::HashMap;
-use gpui::{AbsoluteLength, FontFeatures, SharedString, px};
+use gpui::{AbsoluteLength, FontFeatures, FontWeight, SharedString, px};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use settings_macros::{MergeFrom, with_fallible_options};
@@ -96,8 +96,7 @@ pub struct TerminalSettingsContent {
pub line_height: Option<TerminalLineHeight>,
pub font_features: Option<FontFeatures>,
/// Sets the terminal's font weight in CSS weight units 0-900.
- #[serde(serialize_with = "crate::serialize_optional_f32_with_two_decimal_places")]
- pub font_weight: Option<f32>,
+ pub font_weight: Option<FontWeight>,
/// Default cursor shape for the terminal.
/// Can be "bar", "block", "underline", or "hollow".
///
diff --git a/crates/terminal/src/terminal_settings.rs b/crates/terminal/src/terminal_settings.rs
index 3b3070c6f68..3d70d85f352 100644
--- a/crates/terminal/src/terminal_settings.rs
+++ b/crates/terminal/src/terminal_settings.rs
@@ -95,7 +95,7 @@ impl settings::Settings for TerminalSettings {
)
}),
font_features: user_content.font_features,
- font_weight: user_content.font_weight.map(FontWeight),
+ font_weight: user_content.font_weight,
line_height: user_content.line_height.unwrap(),
env: project_content.env.unwrap(),
cursor_shape: user_content.cursor_shape.unwrap().into(),