From 80e5753db8dcd9005716500e8c084dc78efddc4c Mon Sep 17 00:00:00 2001 From: Krypton Date: Thu, 21 Sep 2023 11:10:23 +0200 Subject: [PATCH] feat(syntax): Diff highlighting --- src/theme/tokens/diff.ts | 43 +++++++++++++++++++++++++++++++++++++++ src/theme/tokens/index.ts | 2 ++ 2 files changed, 45 insertions(+) create mode 100644 src/theme/tokens/diff.ts diff --git a/src/theme/tokens/diff.ts b/src/theme/tokens/diff.ts new file mode 100644 index 00000000..980f6a65 --- /dev/null +++ b/src/theme/tokens/diff.ts @@ -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; diff --git a/src/theme/tokens/index.ts b/src/theme/tokens/index.ts index 80ec89af..adcac026 100644 --- a/src/theme/tokens/index.ts +++ b/src/theme/tokens/index.ts @@ -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"; @@ -292,6 +293,7 @@ export default (context: ThemeContext) => { cpp, css, data, + diff, dotenv, golang, graphql,