Skip to content

Commit

Permalink
Control width of formatted blame fields
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Nov 9, 2021
1 parent acc58c8 commit 259d207
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ pub struct Opt {
/// "{timestamp}", "{author}", and "{commit}".
#[structopt(
long = "blame-format",
default_value = "{timestamp:<15} {author:<15} {commit:<8} │ "
default_value = "{timestamp:<15} {author:<15.14} {commit:<8} │ "
)]
pub blame_format: String,

Expand Down
2 changes: 1 addition & 1 deletion src/handlers/blame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn format_blame_metadata(
.unwrap_or(&format::Align::Left);
let width = placeholder.width.unwrap_or(15);

let pad = |s| format::pad(s, width, alignment_spec, None);
let pad = |s| format::pad(s, width, alignment_spec, placeholder.precision);
let field = match placeholder.placeholder {
Some(Placeholder::Str("timestamp")) => Some(Cow::from(
chrono_humanize::HumanTime::from(blame.time).to_string(),
Expand Down

0 comments on commit 259d207

Please sign in to comment.