From 4bdf01858d2bb8ccfd029bff20ef05ac1f42db6b Mon Sep 17 00:00:00 2001 From: Justin Su Date: Thu, 2 Apr 2026 09:09:29 -0400 Subject: [PATCH] Don't save buffers by default when running tasks (#52976) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #52926 Follow-up to #48861 cc @SomeoneToIgnore Release Notes: - Edited buffers are no longer saved by default before running a task, but you can still configure this using the "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov --- assets/settings/initial_tasks.json | 4 ++-- crates/task/src/task_template.rs | 2 +- docs/src/tasks.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/settings/initial_tasks.json b/assets/settings/initial_tasks.json index 0d6f4471320e443f3c4a483f53f6901c76e7dc72..bb6c9c04ae14db8f2d01adabd8d1494caa7d7407 100644 --- a/assets/settings/initial_tasks.json +++ b/assets/settings/initial_tasks.json @@ -50,9 +50,9 @@ "show_command": true, // Which edited buffers to save before running the task: // * `all` — save all edited buffers - // * `current` — save current buffer only + // * `current` — save currently active buffer only // * `none` — don't save any buffers - "save": "all", + "save": "none", // Represents the tags for inline runnable indicators, or spawning multiple tasks at once. // "tags": [] }, diff --git a/crates/task/src/task_template.rs b/crates/task/src/task_template.rs index cee6024ca62fb1ed74489f55ae99f6334db3d0f0..5f5fef6a1c642183472b43490d25629bcd6cec25 100644 --- a/crates/task/src/task_template.rs +++ b/crates/task/src/task_template.rs @@ -116,11 +116,11 @@ pub enum HideStrategy { #[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] pub enum SaveStrategy { - #[default] /// Save all edited buffers. All, /// Save the current buffer. Current, + #[default] /// Don't save any buffers. None, } diff --git a/docs/src/tasks.md b/docs/src/tasks.md index b4c9ba8a2abf5ce03e4a9a43fe7fc7e55f9240a4..3bbef85e9760ad036b75d50f26d3536b2e5b20f1 100644 --- a/docs/src/tasks.md +++ b/docs/src/tasks.md @@ -53,9 +53,9 @@ Zed supports ways to spawn (and rerun) commands using its integrated [terminal]( "show_command": true, // Which edited buffers to save before running the task: // * `all` — save all edited buffers - // * `current` — save current buffer only + // * `current` — save currently active buffer only // * `none` — don't save any buffers - "save": "all" + "save": "none" // Represents the tags for inline runnable indicators, or spawning multiple tasks at once. // "tags": [] }