Switch from delete file by default to trash file by default (#10875)
TODO: - [x] Don't immediately seg fault - [x] Implement for directories - [x] Add cmd-delete to remove files - [ ] ~~Add setting for trash vs. delete~~ You can just use keybindings to change the behavior. fixes https://github.com/zed-industries/zed/issues/7228 fixes https://github.com/zed-industries/zed/issues/5094 Release Notes: - Added a new `project_panel::Trash` action and changed the default behavior for `backspace` and `delete` in the project panel to send a file to the systems trash, instead of permanently deleting it ([#7228](https://github.com/zed-industries/zed/issues/7228), [#5094](https://github.com/zed-industries/zed/issues/5094)). The original behavior can be restored by adding the following section to your keybindings: ```json5 [ // ...Other keybindings... { "context": "ProjectPanel", "bindings": { "backspace": "project_panel::Delete", "delete": "project_panel::Delete", } } ]
This commit is contained in:
parent
5dbd23f6b0
commit
d2569afe66
11 changed files with 99 additions and 22 deletions
|
@ -1764,7 +1764,7 @@ fn randomly_mutate_worktree(
|
|||
match rng.gen_range(0_u32..100) {
|
||||
0..=33 if entry.path.as_ref() != Path::new("") => {
|
||||
log::info!("deleting entry {:?} ({})", entry.path, entry.id.0);
|
||||
worktree.delete_entry(entry.id, cx).unwrap()
|
||||
worktree.delete_entry(entry.id, false, cx).unwrap()
|
||||
}
|
||||
..=66 if entry.path.as_ref() != Path::new("") => {
|
||||
let other_entry = snapshot.entries(false).choose(rng).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue