diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 74f9fc18d9..ad1c74a040 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -2832,7 +2832,7 @@ impl Pane { }) .collect::>(); 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;