Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

editor: Deduplicate multibuffer blame error messages (#48013)

Lukas Wirth024345f9998d
diff --git a/crates/editor/src/git/blame.rs b/crates/editor/src/git/blame.rs
index 147989f984d..c705eb3996a 100644
--- a/crates/editor/src/git/blame.rs
+++ b/crates/editor/src/git/blame.rs
@@ -610,21 +610,23 @@ impl GitBlame {
cx.notify();
if !all_errors.is_empty() {
this.project.update(cx, |_, cx| {
+ let all_errors = all_errors
+ .into_iter()
+ .map(|e| format!("{e:#}"))
+ .dedup()
+ .collect::<Vec<_>>();
+ let all_errors = all_errors.join(", ");
if this.user_triggered {
- log::error!("failed to get git blame data: {all_errors:?}");
- let notification = all_errors
- .into_iter()
- .format_with(",", |e, f| f(&format_args!("{:#}", e)))
- .to_string();
+ log::error!("failed to get git blame data: {all_errors}");
cx.emit(project::Event::Toast {
notification_id: "git-blame".into(),
- message: notification,
+ message: all_errors,
link: None,
});
} else {
// If we weren't triggered by a user, we just log errors in the background, instead of sending
// notifications.
- log::debug!("failed to get git blame data: {all_errors:?}");
+ log::debug!("failed to get git blame data: {all_errors}");
}
})
}