Add OS specific settings (#35756)
Release Notes: - Settings can now be configured per operating system with the new top-level fields: `"macos"`/`"windows"`/`"linux"`. These will override user level settings, but are lower precedence than _release channel_ settings.
This commit is contained in:
parent
fa2ff3ce1c
commit
e2e147ab0e
4 changed files with 45 additions and 10 deletions
|
@ -308,10 +308,14 @@ impl Settings for LineIndicatorFormat {
|
|||
type FileContent = Option<LineIndicatorFormatContent>;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> anyhow::Result<Self> {
|
||||
let format = [sources.release_channel, sources.user]
|
||||
.into_iter()
|
||||
.find_map(|value| value.copied().flatten())
|
||||
.unwrap_or(sources.default.ok_or_else(Self::missing_default)?);
|
||||
let format = [
|
||||
sources.release_channel,
|
||||
sources.operating_system,
|
||||
sources.user,
|
||||
]
|
||||
.into_iter()
|
||||
.find_map(|value| value.copied().flatten())
|
||||
.unwrap_or(sources.default.ok_or_else(Self::missing_default)?);
|
||||
|
||||
Ok(format.0)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue