diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index d634ed1353cdeb397890acb2940f0243bd1a0ee6..74103874da7e0582d0ae42e34f1ce4b479178ee6 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -2790,7 +2790,7 @@ impl Pane { }) .collect::>(); let tab_count = tab_items.len(); - let safe_pinned_count = if self.pinned_tab_count > tab_count { + if self.pinned_tab_count > tab_count { log::warn!( "Pinned tab count ({}) exceeds actual tab count ({}). \ This should not happen. If possible, add reproduction steps, \ @@ -2798,11 +2798,9 @@ impl Pane { self.pinned_tab_count, tab_count ); - tab_count - } else { - self.pinned_tab_count - }; - let unpinned_tabs = tab_items.split_off(safe_pinned_count); + self.pinned_tab_count = tab_count; + } + let unpinned_tabs = tab_items.split_off(self.pinned_tab_count); let pinned_tabs = tab_items; TabBar::new("tab_bar") .when(