cli: indent commits summary in single revset resolution hint

This is the same formatting as "jj abandon" output. It should improve the
discoverability of the trailing hint.
This commit is contained in:
Yuya Nishihara 2024-03-24 16:42:04 +09:00
parent 65ef700f94
commit 15ff7dfd48
4 changed files with 25 additions and 24 deletions

View file

@ -800,11 +800,12 @@ impl WorkspaceCommandHelper {
let mut output = Vec::new();
let mut formatter = PlainTextFormatter::new(&mut output);
for commit in &commits {
write!(formatter, " ")?;
template.format(commit, &mut formatter).unwrap();
writeln!(formatter).unwrap();
}
if elided {
writeln!(formatter, "...").unwrap();
writeln!(formatter, " ...").unwrap();
}
output.pop(); // drop last newline
String::from_utf8(output).expect("template output should be utf-8 bytes")