diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 1abea7c471c5fd889b539c0ebef9d55b6e31824f..811818314eef6c8f0221ed383b245257c5791d2e 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -2909,17 +2909,14 @@ fn render_blame_entry( let pretty_commit_id = format!("{}", blame_entry.sha); let short_commit_id = pretty_commit_id.clone().chars().take(6).collect::(); - let name = blame_entry.author.as_deref().unwrap_or(""); - let name = if name.len() > 20 { - format!("{}...", &name[..16]) - } else { - name.to_string() - }; + let author_name = blame_entry.author.as_deref().unwrap_or(""); + let name = util::truncate_and_trailoff(author_name, 20); let permalink = blame.read(cx).permalink_for_entry(&blame_entry); let commit_message = blame.read(cx).message_for_entry(&blame_entry); h_flex() + .w_full() .font(text_style.font().family) .line_height(text_style.line_height) .id(("blame", ix)) @@ -2929,8 +2926,12 @@ fn render_blame_entry( .child(short_commit_id) .mr_2(), div() + .w_full() + .h_flex() + .justify_between() .text_color(cx.theme().status().hint) - .child(format!("{:20} {: >14}", name, relative_timestamp)), + .child(name) + .child(relative_timestamp), ]) .on_mouse_down(MouseButton::Right, { let blame_entry = blame_entry.clone();