diff --git a/src/cli.rs b/src/cli.rs index ed1698092..5bb543083 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -499,9 +499,14 @@ pub struct Opt { )] pub blame_format: String, - /// Separator between the commit metadata and code sections of a line of git blame output. - #[structopt(long = "blame-separator", default_value = "│")] - pub blame_separator: String, + /// Separator between the commit metadata and code sections of a line of git blame output. Contains + /// the line number by default. Possible values are "off" to disable line numbers or a format + /// string. This may contain one "{n}" placeholder and will display the line number on every line. + /// If the type is given as block ("{n:block}") the line number will only be shown when a new blame + /// block starts; or if it is given as "{n:every-N}" the line will be show with every block and every + /// N-th (modulo) line. + #[structopt(long = "blame-separator-format", default_value = "│{n:^4}│")] + pub blame_separator_format: String, #[structopt(long = "blame-separator-style")] /// Style (foreground, background, attributes) for the separator between the commit metadata and diff --git a/src/config.rs b/src/config.rs index 1b8e759bd..1acd20a3a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -18,6 +18,8 @@ use crate::features::navigate; use crate::features::side_by_side::{self, ansifill, LeftRight}; use crate::git_config::{GitConfig, GitConfigEntry}; use crate::handlers; +use crate::handlers::blame::parse_blame_line_numbers; +use crate::handlers::blame::BlameLineNumbers; use crate::minusplus::MinusPlus; use crate::paint::BgFillMethod; use crate::parse_styles; @@ -64,8 +66,8 @@ pub struct Config { pub background_color_extends_to_terminal_width: bool, pub blame_code_style: Option