From 62ca45953f5254a1b434725799d6e10ca63577fa Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 26 Dec 2021 22:01:24 -0500 Subject: blame-separator and blame-separator-style options --- src/parse_styles.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/parse_styles.rs') diff --git a/src/parse_styles.rs b/src/parse_styles.rs index eea3c11f..1bee9e54 100644 --- a/src/parse_styles.rs +++ b/src/parse_styles.rs @@ -22,6 +22,7 @@ pub fn parse_styles(opt: &cli::Opt) -> HashMap { make_hunk_styles(opt, &mut styles); make_commit_file_hunk_header_styles(opt, &mut styles); make_line_number_styles(opt, &mut styles); + make_blame_styles(opt, &mut styles); make_grep_styles(opt, &mut styles); make_merge_conflict_styles(opt, &mut styles); make_misc_styles(opt, &mut styles); @@ -360,6 +361,33 @@ fn make_commit_file_hunk_header_styles(opt: &cli::Opt, styles: &mut HashMap<&str ]); } +fn make_blame_styles(opt: &cli::Opt, styles: &mut HashMap<&str, StyleReference>) { + if let Some(style_string) = &opt.blame_code_style { + styles.insert( + "blame-code-style", + style_from_str( + style_string, + None, + None, + opt.computed.true_color, + opt.git_config.as_ref(), + ), + ); + }; + if let Some(style_string) = &opt.blame_separator_style { + styles.insert( + "blame-separator-style", + style_from_str( + style_string, + None, + None, + opt.computed.true_color, + opt.git_config.as_ref(), + ), + ); + }; +} + fn make_grep_styles(opt: &cli::Opt, styles: &mut HashMap<&str, StyleReference>) { styles.extend([ ( -- cgit v1.2.3