From 8f29c9145d6d2b146fdf80e39adbf1c460ef5702 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Thu, 20 Oct 2022 21:03:02 -0400 Subject: [PATCH] flush writes on force quit When force quitting, we need to block on the pending writes to ensure that write commands succeed before exiting, and also to avoid a crash when all the views are gone before the auto format call returns from the LS. --- helix-term/src/commands/typed.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index f20e71c25f232..8d44179cfe74b 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -51,6 +51,7 @@ fn force_quit( ensure!(args.is_empty(), ":quit! takes no arguments"); + cx.block_try_flush_writes()?; cx.editor.close(view!(cx.editor).id); Ok(())