From 03724ca7a18653b007e5ceb8c696b83203a27e75 Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Wed, 18 Nov 2026 12:34:40 +0000 Subject: [PATCH] quit: a failed save asks about the same document again without listing it twice --- crates/quit/src/close.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/quit/src/close.rs b/crates/quit/src/close.rs index 63c90f3b2..1d298a826 100644 --- a/crates/quit/src/close.rs +++ b/crates/quit/src/close.rs @@ -182,7 +182,11 @@ impl CloseGuard { /// the apply-to-all answer clears, and the guard asks about that document again. pub fn retry_after_failure(&mut self) -> GuardStep { let Some(doc) = self.saving.take() else { return self.cancel() }; - self.pending.push_front(doc.clone()); + // A save keeps its document at the front until `saved`; only a document forgotten while + // the save ran needs putting back. + if self.pending.front() != Some(&doc) { + self.pending.push_front(doc.clone()); + } self.apply_to_all = None; GuardStep::Ask(doc) }