Skip to content

Commit

Permalink
feat(syntax): Diff highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrypt0nn committed Sep 21, 2023
1 parent 995a6ca commit 80e5753
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/theme/tokens/diff.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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

0 comments on commit 80e5753

Please sign in to comment.