diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-12-26 22:01:24 -0500 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2021-12-28 12:16:43 +0000 |
commit | 62ca45953f5254a1b434725799d6e10ca63577fa (patch) | |
tree | 1844035115ea467785c674ebedf4334b095d1d56 /src/parse_styles.rs | |
parent | 76905c8e8712e2ac06dbcc59f89bf0c3e41e7972 (diff) |
blame-separator and blame-separator-style options
Diffstat (limited to 'src/parse_styles.rs')
-rw-r--r-- | src/parse_styles.rs | 28 |
1 files changed, 28 insertions, 0 deletions
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<String, Style> { 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([ ( |