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.

Piotr/z 2556 add create branch button (#2696)

Piotr Osiewicze69240cf13c4
diff --cc crates/vcs_menu/src/lib.rs
index 3858960f360,184c1f4733d..d4d0a3d1872
--- a/crates/vcs_menu/src/lib.rs
+++ b/crates/vcs_menu/src/lib.rs
@@@ -66,10 -68,16 +71,18 @@@ pub struct BranchListDelegate
workspace: ViewHandle<Workspace>,
selected_index: usize,
last_query: String,
+ /// Max length of branch name before we truncate it and add a trailing `...`.
+ branch_name_trailoff_after: usize,
}
+ impl BranchListDelegate {
+ fn display_error_toast(&self, message: String, cx: &mut ViewContext<BranchList>) {
+ const GIT_CHECKOUT_FAILURE_ID: usize = 2048;
+ self.workspace.update(cx, |model, ctx| {
+ model.show_toast(Toast::new(GIT_CHECKOUT_FAILURE_ID, message), ctx)
+ });
+ }
+ }
impl PickerDelegate for BranchListDelegate {
fn placeholder_text(&self) -> Arc<str> {
"Select branch...".into()