Show a user-visible error message if saving fails (#19311)
Release Notes: - Added a user-visible error message when a manual save fails.
This commit is contained in:
parent
fedd177b08
commit
08b1545c85
1 changed files with 6 additions and 4 deletions
|
@ -46,7 +46,9 @@ use itertools::Itertools;
|
||||||
use language::{LanguageRegistry, Rope};
|
use language::{LanguageRegistry, Rope};
|
||||||
pub use modal_layer::*;
|
pub use modal_layer::*;
|
||||||
use node_runtime::NodeRuntime;
|
use node_runtime::NodeRuntime;
|
||||||
use notifications::{simple_message_notification::MessageNotification, NotificationHandle};
|
use notifications::{
|
||||||
|
simple_message_notification::MessageNotification, DetachAndPromptErr, NotificationHandle,
|
||||||
|
};
|
||||||
pub use pane::*;
|
pub use pane::*;
|
||||||
pub use pane_group::*;
|
pub use pane_group::*;
|
||||||
pub use persistence::{
|
pub use persistence::{
|
||||||
|
@ -4359,17 +4361,17 @@ impl Workspace {
|
||||||
.on_action(cx.listener(|workspace, action: &Save, cx| {
|
.on_action(cx.listener(|workspace, action: &Save, cx| {
|
||||||
workspace
|
workspace
|
||||||
.save_active_item(action.save_intent.unwrap_or(SaveIntent::Save), cx)
|
.save_active_item(action.save_intent.unwrap_or(SaveIntent::Save), cx)
|
||||||
.detach_and_log_err(cx);
|
.detach_and_prompt_err("Failed to save", cx, |_, _| None);
|
||||||
}))
|
}))
|
||||||
.on_action(cx.listener(|workspace, _: &SaveWithoutFormat, cx| {
|
.on_action(cx.listener(|workspace, _: &SaveWithoutFormat, cx| {
|
||||||
workspace
|
workspace
|
||||||
.save_active_item(SaveIntent::SaveWithoutFormat, cx)
|
.save_active_item(SaveIntent::SaveWithoutFormat, cx)
|
||||||
.detach_and_log_err(cx);
|
.detach_and_prompt_err("Failed to save", cx, |_, _| None);
|
||||||
}))
|
}))
|
||||||
.on_action(cx.listener(|workspace, _: &SaveAs, cx| {
|
.on_action(cx.listener(|workspace, _: &SaveAs, cx| {
|
||||||
workspace
|
workspace
|
||||||
.save_active_item(SaveIntent::SaveAs, cx)
|
.save_active_item(SaveIntent::SaveAs, cx)
|
||||||
.detach_and_log_err(cx);
|
.detach_and_prompt_err("Failed to save", cx, |_, _| None);
|
||||||
}))
|
}))
|
||||||
.on_action(cx.listener(|workspace, _: &ActivatePreviousPane, cx| {
|
.on_action(cx.listener(|workspace, _: &ActivatePreviousPane, cx| {
|
||||||
workspace.activate_previous_pane(cx)
|
workspace.activate_previous_pane(cx)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue