diff --git a/src/prs.rs b/src/prs.rs index 72a0f7d..1623f04 100644 --- a/src/prs.rs +++ b/src/prs.rs @@ -187,6 +187,16 @@ impl PrCommand { } pub async fn view_pr(repo: &RepoName, api: &Forgejo, id: u64) -> eyre::Result<()> { + let crate::SpecialRender { + dash, + body_prefix, + + bright_red, + bright_green, + reset, + .. + } = crate::special_render(); + let mut additions = 0; let mut deletions = 0; let query = RepoGetPullRequestFilesQuery { @@ -217,13 +227,13 @@ pub async fn view_pr(repo: &RepoName, api: &Forgejo, id: u64) -> eyre::Result<() .ok_or_else(|| eyre::eyre!("user does not have login"))?; println!("#{}: {}", id, title); println!( - "By {} - \x1b[92m+{additions} \x1b[91m-{deletions}\x1b[0m", + "By {} {dash} {bright_green}+{additions} {bright_red}-{deletions}{reset}", username ); if let Some(body) = &pr.body { println!(); for line in body.lines() { - println!(" {line}"); + println!("{body_prefix} {line}"); } println!(); } @@ -409,6 +419,13 @@ async fn view_diff( } async fn view_pr_files(repo: &RepoName, api: &Forgejo, pr: u64) -> eyre::Result<()> { + let crate::SpecialRender { + bright_red, + bright_green, + reset, + .. + } = crate::special_render(); + let query = RepoGetPullRequestFilesQuery { limit: Some(u32::MAX), ..Default::default() @@ -434,7 +451,7 @@ async fn view_pr_files(repo: &RepoName, api: &Forgejo, pr: u64) -> eyre::Result< let name = file.filename.as_deref().unwrap_or("???"); let additions = file.additions.unwrap_or_default(); let deletions = file.deletions.unwrap_or_default(); - println!("\x1b[92m+{additions:"); print!("Date: "); let format = time::macros::format_description!("[weekday repr:short] [month repr:short] [day] [hour repr:24]:[minute]:[second] [year] [offset_hour sign:mandatory][offset_minute]");