From e819121f6e3a462b57e728fe5156783e1a8a3035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 15 Jun 2021 01:01:58 +0900 Subject: [PATCH] fix: wq/wqa functions need to wait for save to finish before closing --- helix-term/src/commands.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 09048f48..b5f37563 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -958,7 +958,7 @@ mod cmd { if autofmt { doc.format(view.id); // TODO: merge into save } - tokio::spawn(doc.save()); + helix_lsp::block_on(doc.save()); Ok(()) } @@ -1051,7 +1051,7 @@ mod cmd { errors.push_str("cannot write a buffer without a filename\n"); continue; } - tokio::spawn(doc.save()); + helix_lsp::block_on(doc.save()); } editor.set_error(errors);