Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(syntax): Diff highlighting #182

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/theme/tokens/diff.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import type { TextmateColors, ThemeContext } from "../../types";

const tokens = (context: ThemeContext): TextmateColors => {
const { palette } = context;

return [
{
name: "Markup Diff",
scope: "markup.changed.diff",
settings: {
foreground: palette.peach,
fontStyle: "",
},
},
{
name: "Diff",
scope: [
"meta.diff.header.from-file",
"meta.diff.header.to-file",
"punctuation.definition.from-file.diff",
"punctuation.definition.to-file.diff",
],
settings: {
foreground: palette.blue,
fontStyle: "",
},
},
{
name: "Diff Inserted",
scope: "markup.inserted.diff",
settings: {
foreground: palette.green,
fontStyle: "",
},
},
{
name: "Diff Deleted",
scope: "markup.deleted.diff",
settings: {
foreground: palette.red,
fontStyle: "",
},
},
];
};

export default tokens;
2 changes: 2 additions & 0 deletions src/theme/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ThemeContext } from "../../types";
import cpp from "./cpp";
import css from "./css";
import data from "./data";
import diff from "./diff";
import dotenv from "./dotenv";
import golang from "./golang";
import graphql from "./graphql";
Expand Down Expand Up @@ -292,6 +293,7 @@ export default (context: ThemeContext) => {
cpp,
css,
data,
diff,
dotenv,
golang,
graphql,
Expand Down
Loading