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.

Fix tab switcher spacing bug (#41329)

Anthony Eid2163580b16e8
diff --git a/crates/picker/src/picker.rs b/crates/picker/src/picker.rs
index 90423bcace0..d9a23ec93b8 100644
--- a/crates/picker/src/picker.rs
+++ b/crates/picker/src/picker.rs
@@ -275,6 +275,15 @@ impl<D: PickerDelegate> Picker<D> {
Self::new(delegate, ContainerKind::UniformList, head, window, cx)
}
+ /// A picker, which displays its matches using `gpui::list`, matches can have different heights.
+ /// The picker allows the user to perform search items by text.
+ /// If `PickerDelegate::render_match` only returns items with the same height, use `Picker::uniform_list` as its implementation is optimized for that.
+ pub fn nonsearchable_list(delegate: D, window: &mut Window, cx: &mut Context<Self>) -> Self {
+ let head = Head::empty(Self::on_empty_head_blur, window, cx);
+
+ Self::new(delegate, ContainerKind::List, head, window, cx)
+ }
+
/// A picker, which displays its matches using `gpui::list`, matches can have different heights.
/// The picker allows the user to perform search items by text.
/// If `PickerDelegate::render_match` only returns items with the same height, use `Picker::uniform_list` as its implementation is optimized for that.
diff --git a/crates/tab_switcher/src/tab_switcher.rs b/crates/tab_switcher/src/tab_switcher.rs
index 2923ee6dd4b..8b582796b37 100644
--- a/crates/tab_switcher/src/tab_switcher.rs
+++ b/crates/tab_switcher/src/tab_switcher.rs
@@ -155,9 +155,9 @@ impl TabSwitcher {
Self {
picker: cx.new(|cx| {
if is_global {
- Picker::uniform_list(delegate, window, cx)
+ Picker::list(delegate, window, cx)
} else {
- Picker::nonsearchable_uniform_list(delegate, window, cx)
+ Picker::nonsearchable_list(delegate, window, cx)
}
}),
init_modifiers,