Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

settings_ui: Move deleted skills to trash instead of permanently deleting (#61031)

Smit Barmase9eb5fa98f1dc
diff --git a/crates/settings_ui/src/pages/skills_setup.rs b/crates/settings_ui/src/pages/skills_setup.rs
index 837f044bede..bf450c76c2f 100644
--- a/crates/settings_ui/src/pages/skills_setup.rs
+++ b/crates/settings_ui/src/pages/skills_setup.rs
@@ -227,8 +227,8 @@ fn render_skill_row(
let app_state = workspace::AppState::global(cx);
let fs = app_state.fs.clone();
cx.spawn(async move |settings_window, cx| {
- let remove_result = fs
- .remove_dir(
+ let trash_result = fs
+ .trash(
&directory_path,
RemoveOptions {
recursive: true,
@@ -236,9 +236,9 @@ fn render_skill_row(
},
)
.await;
- if let Err(error) = remove_result {
+ if let Err(error) = trash_result {
log::error!(
- "failed to delete skill directory {}: {error:#}",
+ "failed to move skill directory {} to trash: {error:#}",
directory_path.display()
);
settings_window