From f1a082a24e11193dc90f386ac3142f2b31329c0d Mon Sep 17 00:00:00 2001 From: KillTheMule Date: Thu, 16 Jan 2020 16:59:59 +0100 Subject: [PATCH] Use spawn_blocking Receiving on a sync channel will otherwise block the thread --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 3e54767..ea8bf6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,7 +114,7 @@ fn main() { let editor = Arc::new(Mutex::new(Editor::new(INITIAL_WIDTH, INITIAL_HEIGHT))); let (sender, receiver) = channel::(); let editor_clone = editor.clone(); - rt.spawn(async move { + rt.spawn_blocking(async move { start_nvim(editor_clone, receiver).await; }); ui_loop(editor, sender, (INITIAL_WIDTH, INITIAL_HEIGHT));