We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e12f05 commit babcbcfCopy full SHA for babcbcf
crates/workspace/src/pane.rs
@@ -755,7 +755,7 @@ impl Pane {
755
}
756
757
pub(crate) fn set_pinned_count(&mut self, count: usize) {
758
- self.pinned_tab_count = count;
+ self.pinned_tab_count = count.min(self.items.len());
759
760
761
pub(crate) fn pinned_count(&self) -> usize {
@@ -1890,7 +1890,7 @@ impl Pane {
1890
fn unpin_tab_at(&mut self, ix: usize, cx: &mut ViewContext<'_, Self>) {
1891
maybe!({
1892
let pane = cx.view().clone();
1893
- self.pinned_tab_count = self.pinned_tab_count.checked_sub(1).unwrap();
+ self.pinned_tab_count = self.pinned_tab_count.checked_sub(1)?;
1894
let destination_index = self.pinned_tab_count;
1895
1896
let id = self.item_for_index(ix)?.item_id();
0 commit comments