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.

theme: Change autocomplete value for `*_font_fallbacks` (#16759)

张小白30a677e2576a
diff --git a/crates/theme/src/settings.rs b/crates/theme/src/settings.rs
index 60f4768f06c..719e276c575 100644
--- a/crates/theme/src/settings.rs
+++ b/crates/theme/src/settings.rs
@@ -247,6 +247,7 @@ pub struct ThemeSettingsContent {
pub ui_font_family: Option<String>,
/// The font fallbacks to use for rendering in the UI.
#[serde(default)]
+ #[schemars(default = "default_font_fallbacks")]
pub ui_font_fallbacks: Option<Vec<String>>,
/// The OpenType features to enable for text in the UI.
#[serde(default)]
@@ -260,6 +261,7 @@ pub struct ThemeSettingsContent {
pub buffer_font_family: Option<String>,
/// The font fallbacks to use for rendering in text buffers.
#[serde(default)]
+ #[schemars(default = "default_font_fallbacks")]
pub buffer_font_fallbacks: Option<Vec<String>>,
/// The default font size for rendering in text buffers.
#[serde(default)]
@@ -299,6 +301,10 @@ fn default_font_features() -> Option<FontFeatures> {
Some(FontFeatures::default())
}
+fn default_font_fallbacks() -> Option<FontFallbacks> {
+ Some(FontFallbacks::default())
+}
+
impl ThemeSettingsContent {
/// Sets the theme for the given appearance to the theme with the specified name.
pub fn set_theme(&mut self, theme_name: String, appearance: Appearance) {