mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-15 00:22:19 +03:00
trim snapshot progress output
This commit is contained in:
parent
f7764bc665
commit
d038926714
@ -196,10 +196,15 @@ pub fn snapshot_progress(ui: &mut Ui) -> Option<impl Fn(&RepoPath) + '_> {
|
||||
.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!(
|
||||
state.ui,
|
||||
"\r{}Snapshotting {}",
|
||||
"\r{}Snapshotting {:.*}",
|
||||
Clear(ClearType::CurrentLine),
|
||||
path_width,
|
||||
path.to_fs_path(Path::new("")).display()
|
||||
);
|
||||
_ = state.ui.flush();
|
||||
|
Loading…
Reference in New Issue
Block a user