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 Dec 10, 2023
1 parent 100b8b2 commit d3f6d22
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 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,20 @@ impl ParseSettings for Theme {
}
_ => return Err(UndefinedSettings),
};
if let Some(Settings::Object(obj)) = obj.remove("gutterSettings") {
for (key, value) in obj {
let color = Color::parse_settings(value).ok();
match &key[..] {
"background" => {
settings.gutter = settings.gutter.or(color)
}
"foreground" => {
settings.gutter_foreground = settings.gutter_foreground.or(color)
}
_ => (),
}
}
}
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 d3f6d22

Please sign in to comment.