aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-05-11 03:41:44 +0000
committerSkyler Hawthorne2022-10-19 02:31:38 +0000
commit69c9e44ef205a81c112dfb14d5f2e67e5ce9c300 (patch)
treee51a3b064b391cf7c28bc1aa4f111d07b6bba3fc /helix-term/src
parente1f7bdb1d2ef68c0de38e768080291901ff4662e (diff)
update write-quit to wait for saves
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands/typed.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index efe693b9..bc254146 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -518,8 +518,12 @@ fn write_quit(
}
write_impl(cx, args.first(), false)?;
- // TODO: change to use document close
- helix_lsp::block_on(cx.jobs.finish())?;
+ let doc = doc_mut!(cx.editor);
+
+ tokio::task::block_in_place(|| helix_lsp::block_on(doc.try_flush_saves()))
+ .map(|result| result.map(|_| ()))
+ .unwrap_or(Ok(()))?;
+
quit(cx, &[], event)
}