Improve importing font-family settings from VS Code (#39736)

Closes https://github.com/zed-industries/zed/issues/39259

- Fixes import of `editor.fontFamily` (we were looking for the wrong
key)
- Adds basic support for the CSS font-family syntax used by VS Code,
including font fallback

Release Notes:

- N/A
This commit is contained in:
John Tur
2025-10-08 19:19:48 -04:00
committed by GitHub
parent 3d0312f4c7
commit ef839cc207
5 changed files with 110 additions and 8 deletions
+5 -3
View File
@@ -731,9 +731,11 @@ impl settings::Settings for ThemeSettings {
fn import_from_vscode(vscode: &settings::VsCodeSettings, current: &mut SettingsContent) {
vscode.from_f32_setting("editor.fontWeight", &mut current.theme.buffer_font_weight);
vscode.from_f32_setting("editor.fontSize", &mut current.theme.buffer_font_size);
if let Some(font) = vscode.read_string("editor.font") {
current.theme.buffer_font_family = Some(FontFamilyName(font.into()));
}
vscode.font_family_setting(
"editor.fontFamily",
&mut current.theme.buffer_font_family,
&mut current.theme.buffer_font_fallbacks,
)
// TODO: possibly map editor.fontLigatures to buffer_font_features?
}
}