mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 23:06:45 +00:00
trim snapshot progress output
This commit is contained in:
parent
f7764bc665
commit
d038926714
1 changed files with 6 additions and 1 deletions
|
@ -196,10 +196,15 @@ pub fn snapshot_progress(ui: &mut Ui) -> Option<impl Fn(&RepoPath) + '_> {
|
||||||
.output_guard(format!("\r{}", Clear(ClearType::CurrentLine))),
|
.output_guard(format!("\r{}", Clear(ClearType::CurrentLine))),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let line_width = state.ui.term_width().map(usize::from).unwrap_or(80);
|
||||||
|
let path_width = line_width.saturating_sub(13); // Account for "Snapshotting "
|
||||||
|
|
||||||
_ = write!(
|
_ = write!(
|
||||||
state.ui,
|
state.ui,
|
||||||
"\r{}Snapshotting {}",
|
"\r{}Snapshotting {:.*}",
|
||||||
Clear(ClearType::CurrentLine),
|
Clear(ClearType::CurrentLine),
|
||||||
|
path_width,
|
||||||
path.to_fs_path(Path::new("")).display()
|
path.to_fs_path(Path::new("")).display()
|
||||||
);
|
);
|
||||||
_ = state.ui.flush();
|
_ = state.ui.flush();
|
||||||
|
|
Loading…
Reference in a new issue