Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad authored Jan 4, 2021
1 parent b24112d commit e156c83
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
*.vsix
target/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"repository": {
"url": "https://github.com/matklad/pale-fire"
},
"version": "0.2.6",
"version": "0.2.7",
"engines": {
"vscode": "^1.41.0"
},
Expand Down
26 changes: 15 additions & 11 deletions src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,24 +508,28 @@ impl Theme {
textmate_rule(colors, &["markup.bold"], FontStyle::Bold);
textmate_rule(colors, &["markup.heading"], FontStyle::Underline);

textmate_rule(
colors,
&[
"markup.inserted.diff",
"punctuation.definition.inserted.diff",
],
ZENBURN_GREEN_PLUS_4,
);
textmate_rule(
colors,
&["markup.deleted.diff", "punctuation.definition.deleted.diff"],
ZENBURN_RED_PLUS_2,
);

json::Value::Array(colors_owned)
}
}

fn textmate_rule(rules: &mut Vec<json::Value>, scopes: &[&str], style: impl Into<Style>) {
let mut map = json::Map::new();

map.insert(
"scope".to_string(),
json::Value::Array(
scopes
.iter()
.map(|s| s.to_string())
.map(json::Value::String)
.collect(),
),
);

map.insert("scope".to_string(), scopes.iter().copied().collect());
map.insert("settings".to_string(), style.into().as_json_value(true));

rules.push(json::Value::Object(map));
Expand Down
18 changes: 18 additions & 0 deletions themes/Pale Fire-color-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,24 @@
"settings": {
"fontStyle": "underline"
}
},
{
"scope": [
"markup.inserted.diff",
"punctuation.definition.inserted.diff"
],
"settings": {
"foreground": "#BFEBBF"
}
},
{
"scope": [
"markup.deleted.diff",
"punctuation.definition.deleted.diff"
],
"settings": {
"foreground": "#ECB3B3"
}
}
]
}

0 comments on commit e156c83

Please sign in to comment.