Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Reuse `is_tab_pinned` method (#35551)
Joseph T. Lyons1b9302d452a3
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rsindex 74f9fc18d93..ad1c74a0401 100644--- a/crates/workspace/src/pane.rs+++ b/crates/workspace/src/pane.rs@@ -2832,7 +2832,7 @@ impl Pane {}).collect::<Vec<_>>();let tab_count = tab_items.len();- if self.pinned_tab_count > tab_count {+ if self.is_tab_pinned(tab_count) {log::warn!("Pinned tab count ({}) exceeds actual tab count ({}). \This should not happen. If possible, add reproduction steps, \@@ -3062,13 +3062,13 @@ impl Pane {}to_pane.update(cx, |this, _| {if to_pane == from_pane {- let to_ix = this+ let actual_ix = this.items.iter().position(|item| item.item_id() == item_id).unwrap_or(0);- let is_pinned_in_to_pane = to_ix < this.pinned_tab_count;+ let is_pinned_in_to_pane = this.is_tab_pinned(actual_ix);if !was_pinned_in_from_pane && is_pinned_in_to_pane {this.pinned_tab_count += 1;