Make save all prompt less noisy (#24934)

Don't show clean items from dirty multibuffers, and dedupe filenames in
case you have a file open in a buffer and a multibuffer

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-02-14 22:40:14 -07:00 committed by GitHub
parent e0fc767c11
commit 79e3faffb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 33 deletions

View file

@ -2015,14 +2015,13 @@ impl Workspace {
if remaining_dirty_items.len() > 1 {
let answer = workspace.update_in(&mut cx, |_, window, cx| {
let (prompt, detail) = Pane::file_names_for_prompt(
let detail = Pane::file_names_for_prompt(
&mut remaining_dirty_items.iter().map(|(_, handle)| handle),
remaining_dirty_items.len(),
cx,
);
window.prompt(
PromptLevel::Warning,
&prompt,
&"Do you want to save all changes in the following files?",
Some(&detail),
&["Save all", "Discard all", "Cancel"],
cx,