From a1b8dbc410a1cdfa7341f091c95e8e89e46e28d0 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Thu, 23 Dec 2021 22:27:39 -0500 Subject: New option blame-code-style Fixes #867 --- src/cli.rs | 7 +++++++ src/config.rs | 2 ++ src/handlers/blame.rs | 2 +- src/options/set.rs | 1 + src/parse_styles.rs | 13 +++++++++++++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index ae93cacf..1b60bea5 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -495,6 +495,13 @@ pub struct Opt { )] pub blame_format: String, + #[structopt(long = "blame-code-style")] + /// Style (foreground, background, attributes) for the code section of a line of `git blame` + /// output. By default the code will be syntax-highlighted with the same background color as the + /// blame format section of the line (the background color is determined by blame-palette). E.g. + /// setting this option to 'syntax' will syntax-highlight the code with no background color. + pub blame_code_style: Option, + /// Background colors used for git blame lines (space-separated string). /// Lines added by the same commit are painted with the same color; colors /// are recycled as needed. diff --git a/src/config.rs b/src/config.rs index d7798550..e8d991e4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -60,6 +60,7 @@ fn adapt_wrap_max_lines_argument(arg: String) -> usize { pub struct Config { pub available_terminal_width: usize, pub background_color_extends_to_terminal_width: bool, + pub blame_code_style: Option