preview tabs: Toggle preview tab when saving (#18158)

Release Notes:

- Saving a preview tab will now mark it as a permanent tab
This commit is contained in:
Bennet Bo Fenner 2024-09-20 14:43:26 -04:00 committed by GitHub
parent 601090511b
commit 5d12e3ce3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1595,8 +1595,13 @@ impl Pane {
} }
if can_save { if can_save {
pane.update(cx, |_, cx| item.save(should_format, project, cx))? pane.update(cx, |pane, cx| {
.await?; if pane.is_active_preview_item(item.item_id()) {
pane.set_preview_item_id(None, cx);
}
item.save(should_format, project, cx)
})?
.await?;
} else if can_save_as { } else if can_save_as {
let abs_path = pane.update(cx, |pane, cx| { let abs_path = pane.update(cx, |pane, cx| {
pane.workspace pane.workspace