Skip to content

Commit ddf3bab

Browse files
committed
Improve but status graph rendering
1 parent d577ad9 commit ddf3bab

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

crates/but/src/status/mod.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub(crate) fn worktree(
124124
}
125125
let dot = "●".purple();
126126
println!(
127-
" {dot} {} (common base) [{}] {}",
127+
"{dot} {} (common base) [{}] {}",
128128
common_merge_base_data.common_merge_base.dimmed(),
129129
common_merge_base_data.target_name.green().bold(),
130130
common_merge_base_data.message
@@ -186,7 +186,7 @@ pub fn print_group(
186186
verbose: bool,
187187
stack_mark: &mut Option<ColoredString>,
188188
ctx: &mut CommandContext,
189-
last: bool,
189+
_last: bool,
190190
first: bool,
191191
) -> anyhow::Result<()> {
192192
if let Some(group) = &group {
@@ -198,7 +198,7 @@ pub fn print_group(
198198
.blue();
199199
let notch = if first { "╭" } else { "├" };
200200
if !first {
201-
println!("│");
201+
println!("│");
202202
}
203203

204204
let no_commits = if branch.commits.is_empty() {
@@ -210,7 +210,7 @@ pub fn print_group(
210210
.italic();
211211

212212
println!(
213-
"{}┄{} [{}] {} {}",
213+
"{}┄{} [{}] {} {}",
214214
notch,
215215
id,
216216
branch.name.to_string().green().bold(),
@@ -274,7 +274,7 @@ pub fn print_group(
274274
let formatted_time = datetime.format("%Y-%m-%d %H:%M:%S");
275275

276276
println!(
277-
"{dot} {}{} {} {} {} {} {}",
277+
"{dot} {}{} {} {} {} {} {}",
278278
&commit.id.to_string()[..2].blue().underline(),
279279
&commit.id.to_string()[2..7].dimmed(),
280280
commit.author.name,
@@ -283,11 +283,11 @@ pub fn print_group(
283283
conflicted_str,
284284
mark.unwrap_or_default()
285285
);
286-
println!("│ {message}");
286+
println!("│ {message}");
287287
} else {
288288
// Original format: everything on one line
289289
println!(
290-
"{dot} {}{} {} {} {} {}",
290+
"{dot} {}{} {} {} {} {}",
291291
&commit.id.to_string()[..2].blue().underline(),
292292
&commit.id.to_string()[2..7].dimmed(),
293293
message,
@@ -304,7 +304,7 @@ pub fn print_group(
304304
.underline();
305305
let path = path_with_color(&change.status, change.path.to_string());
306306
let status_letter = status_letter(&change.status);
307-
println!("│ {cid} {status_letter} {path}");
307+
println!("│ {cid} {status_letter} {path}");
308308
}
309309
}
310310
}
@@ -320,13 +320,9 @@ pub fn print_group(
320320
print_assignments(&assignments, changes, true);
321321
}
322322
if !first {
323-
println!("╰╮");
323+
println!("├╯");
324324
}
325-
if last {
326-
println!(" ┊");
327-
} else {
328-
println!(" ");
329-
};
325+
println!("┊");
330326
Ok(())
331327
}
332328

0 commit comments

Comments
 (0)