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.

git_ui: Add tooltip for branch picker items (#38261)

Smit Barmasee885a939baa4
diff --git a/crates/git_ui/src/branch_picker.rs b/crates/git_ui/src/branch_picker.rs
index 42558b7b79b..9a0751c8ede 100644
--- a/crates/git_ui/src/branch_picker.rs
+++ b/crates/git_ui/src/branch_picker.rs
@@ -521,6 +521,14 @@ impl PickerDelegate for BranchListDelegate {
.inset(true)
.spacing(ListItemSpacing::Sparse)
.toggle_state(selected)
+ .tooltip({
+ let branch_name = entry.branch.name().to_string();
+ if entry.is_new {
+ Tooltip::text(format!("Create branch \"{}\"", branch_name))
+ } else {
+ Tooltip::text(branch_name)
+ }
+ })
.child(
v_flex()
.w_full()