From 1e94ca9325aa2e989433b9a5d9931a43817cc352 Mon Sep 17 00:00:00 2001 From: Vasilis Manolopoulos Date: Tue, 18 Mar 2025 19:47:57 +0100 Subject: [PATCH 1/2] Add doc for syntax in THEMES.md --- THEMES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/THEMES.md b/THEMES.md index 2c48953e84..cdc7f96318 100644 --- a/THEMES.md +++ b/THEMES.md @@ -31,7 +31,14 @@ Notes: * using a color like `yellow` might appear in whatever your terminal/theme defines for `yellow` * valid colors can be found in ratatui's [Color](https://docs.rs/ratatui/latest/ratatui/style/enum.Color.html) struct. * all customizable theme elements can be found in [`style.rs` in the `impl Default for Theme` block](https://github.com/gitui-org/gitui/blob/master/src/ui/style.rs#L305) +* the syntax highlighting theme can be defined using the element `syntax`. Currently, only default themes of the syntect library are supported, [available themes](https://github.com/trishume/syntect/blob/7fe13c0fd53cdfa0f9fea1aa14c5ba37f81d8b71/src/dumps.rs#L215). +Example syntax theme: +``` +( + syntax : Some("InspiredGitHub"), +) +``` ## Customizing line breaks If you want to change how the line break is displayed in the diff, you can also specify `line_break` in your `theme.ron`: From 190cce1a610e070c1d43294b60d6cc2e2c49d6ac Mon Sep 17 00:00:00 2001 From: Vasilis Manolopoulos Date: Thu, 20 Mar 2025 09:17:11 +0100 Subject: [PATCH 2/2] Review changes --- THEMES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/THEMES.md b/THEMES.md index cdc7f96318..ffdcc50b5c 100644 --- a/THEMES.md +++ b/THEMES.md @@ -31,12 +31,12 @@ Notes: * using a color like `yellow` might appear in whatever your terminal/theme defines for `yellow` * valid colors can be found in ratatui's [Color](https://docs.rs/ratatui/latest/ratatui/style/enum.Color.html) struct. * all customizable theme elements can be found in [`style.rs` in the `impl Default for Theme` block](https://github.com/gitui-org/gitui/blob/master/src/ui/style.rs#L305) -* the syntax highlighting theme can be defined using the element `syntax`. Currently, only default themes of the syntect library are supported, [available themes](https://github.com/trishume/syntect/blob/7fe13c0fd53cdfa0f9fea1aa14c5ba37f81d8b71/src/dumps.rs#L215). +* the syntax highlighting theme can be defined using the element `syntax`. Currently, only [default themes of the syntect library are supported](https://github.com/trishume/syntect/blob/7fe13c0fd53cdfa0f9fea1aa14c5ba37f81d8b71/src/dumps.rs#L215). Example syntax theme: ``` ( - syntax : Some("InspiredGitHub"), + syntax: Some("InspiredGitHub"), ) ``` ## Customizing line breaks