pane: Update pinned tab counts when unnamed buffer is discarded (#20294)
Closes #19492 Release Notes: - Fixed a crash that could happen when closing a workspace with pinned untitled buffers.
This commit is contained in:
parent
1c84fd1fef
commit
fef7df667c
1 changed files with 7 additions and 2 deletions
|
@ -1593,8 +1593,13 @@ impl Pane {
|
|||
Ok(0) => {}
|
||||
Ok(1) => {
|
||||
// Don't save this file
|
||||
pane.update(cx, |_, cx| item.discarded(project, cx))
|
||||
.log_err();
|
||||
pane.update(cx, |pane, cx| {
|
||||
if pane.is_tab_pinned(item_ix) && !item.can_save(cx) {
|
||||
pane.pinned_tab_count -= 1;
|
||||
}
|
||||
item.discarded(project, cx)
|
||||
})
|
||||
.log_err();
|
||||
return Ok(true);
|
||||
}
|
||||
_ => return Ok(false), // Cancel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue