vcs_menu: Query branches on open instead of per keystroke (#3144)
Release Notes: - Improved performance of branch picker by querying branches on menu open instead of querying once per each keystroke. (fixes zed-industries/community#2161)
This commit is contained in:
parent
26638748bb
commit
fc37abc356
4 changed files with 67 additions and 67 deletions
|
@ -488,7 +488,11 @@ impl CollabTitlebarItem {
|
|||
pub fn toggle_vcs_menu(&mut self, _: &ToggleVcsMenu, cx: &mut ViewContext<Self>) {
|
||||
if self.branch_popover.take().is_none() {
|
||||
if let Some(workspace) = self.workspace.upgrade(cx) {
|
||||
let view = cx.add_view(|cx| build_branch_list(workspace, cx));
|
||||
let Some(view) =
|
||||
cx.add_option_view(|cx| build_branch_list(workspace, cx).log_err())
|
||||
else {
|
||||
return;
|
||||
};
|
||||
cx.subscribe(&view, |this, _, event, cx| {
|
||||
match event {
|
||||
PickerEvent::Dismiss => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue