Skip to content

Commit

Permalink
Add parsing of gutterSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
timhillgit committed Nov 27, 2023
1 parent 95df885 commit 48b6316
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/highlighting/theme_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl ParseSettings for Theme {
_ => return Err(IncorrectSyntax),
};
let mut iter = items.into_iter();
let settings = match iter.next() {
let mut settings = match iter.next() {
Some(Settings::Object(mut obj)) => {
match obj.remove("settings") {
Some(settings) => ThemeSettings::parse_settings(settings)?,
Expand All @@ -309,6 +309,15 @@ impl ParseSettings for Theme {
}
_ => return Err(UndefinedSettings),
};
if let Some(Settings::Object(obj)) = obj.remove("gutterSettings") {
for (key, value) in obj {
match &key[..] {
"background" => settings.gutter = Color::parse_settings(value).ok(),
"foreground" => settings.gutter_foreground = Color::parse_settings(value).ok(),
_ => (),
}
}
}
let mut scopes = Vec::new();
for json in iter {
// TODO option to disable best effort parsing and bubble up warnings
Expand Down

0 comments on commit 48b6316

Please sign in to comment.