diff options
author | Skyler Hawthorne | 2022-05-11 03:41:44 +0000 |
---|---|---|
committer | Skyler Hawthorne | 2022-10-19 02:31:38 +0000 |
commit | 69c9e44ef205a81c112dfb14d5f2e67e5ce9c300 (patch) | |
tree | e51a3b064b391cf7c28bc1aa4f111d07b6bba3fc /helix-term/src/commands | |
parent | e1f7bdb1d2ef68c0de38e768080291901ff4662e (diff) |
update write-quit to wait for saves
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r-- | helix-term/src/commands/typed.rs | 8 |
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) } |