From 757ff791eb53525dac98e302b77986c92b99bd1d 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 0d6f447132..bb6c9c04ae 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 2f74d84e50..25fde261f1 100644 --- a/crates/task/src/task_template.rs +++ b/crates/task/src/task_template.rs @@ -127,11 +127,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 b4c9ba8a2a..3bbef85e97 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": [] }