Revert "settings: Remove auxiliary Content types where possible (#16744)" (#17768)

This breaks setting `{"scrollbar": {"show":"never"}}`
Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-09-12 14:46:08 -04:00 committed by GitHub
parent 3b37db4140
commit 4d26f83d23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 686 additions and 833 deletions

View file

@ -177,7 +177,7 @@ impl PickerDelegate for BaseKeymapSelectorDelegate {
.report_setting_event("keymap", base_keymap.to_string());
update_settings_file::<BaseKeymap>(self.fs.clone(), cx, move |setting, _| {
*setting = base_keymap;
*setting = Some(base_keymap)
});
}

View file

@ -87,15 +87,15 @@ impl BaseKeymap {
impl Settings for BaseKeymap {
const KEY: Option<&'static str> = Some("base_keymap");
type FileContent = Self;
type FileContent = Option<Self>;
fn load(
sources: SettingsSources<Self::FileContent>,
_: &mut gpui::AppContext,
) -> anyhow::Result<Self> {
if let Some(user_value) = sources.user.copied() {
if let Some(Some(user_value)) = sources.user.copied() {
return Ok(user_value);
}
Ok(*sources.default)
sources.default.ok_or_else(Self::missing_default)
}
}

View file

@ -188,7 +188,7 @@ impl Render for WelcomePage {
this.update_settings::<VimModeSetting>(
selection,
cx,
|setting, value| *setting = VimModeSetting(value),
|setting, value| *setting = Some(value),
);
}),
))