@@ -34,6 +34,7 @@ fn quit(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
34 buffers_remaining_impl(cx.editor)?
34 buffers_remaining_impl(cx.editor)?
37+ cx.block_try_flush_writes()?;
37 cx.editor.close(view!(cx.editor).id);
38 cx.editor.close(view!(cx.editor).id);
@@ -518,15 +519,7 @@ fn write_quit(
520 write_impl(cx, args.first(), false)?;
521 write_impl(cx, args.first(), false)?;
521−
522+ cx.block_try_flush_writes()?;
522− tokio::task::block_in_place(|| helix_lsp::block_on(cx.jobs.finish(Some(cx.editor), None)))?;
524− let doc = doc_mut!(cx.editor);
526− tokio::task::block_in_place(|| helix_lsp::block_on(doc.try_flush_saves()))
527− .map(|result| result.map(|_| ()))
528− .unwrap_or(Ok(()))?;
530 quit(cx, &[], event)
523 quit(cx, &[], event)
@@ -540,6 +533,7 @@ fn force_write_quit(
542 write_impl(cx, args.first(), true)?;
535 write_impl(cx, args.first(), true)?;
536+ cx.block_try_flush_writes()?;
543 force_quit(cx, &[], event)
537 force_quit(cx, &[], event)
@@ -613,6 +607,8 @@ fn write_all_impl(
613 buffers_remaining_impl(cx.editor)?;
607 buffers_remaining_impl(cx.editor)?;
610+ cx.block_try_flush_writes()?;
616 // close all views
612 // close all views
617 let views: Vec<_> = cx.editor.tree.views().map(|(view, _)| view.id).collect();
613 let views: Vec<_> = cx.editor.tree.views().map(|(view, _)| view.id).collect();
618 for view_id in views {
614 for view_id in views {
@@ -682,6 +678,7 @@ fn quit_all(
682 return Ok(());
678 return Ok(());
681+ cx.block_try_flush_writes()?;
685 quit_all_impl(cx.editor, false)
682 quit_all_impl(cx.editor, false)
@@ -710,8 +707,9 @@ fn cquit(
711 .and_then(|code| code.parse::<i32>().ok())
708 .and_then(|code| code.parse::<i32>().ok())
712 .unwrap_or(1);
709 .unwrap_or(1);
713− cx.editor.exit_code = exit_code;
711+ cx.editor.exit_code = exit_code;
712+ cx.block_try_flush_writes()?;
715 quit_all_impl(cx.editor, false)
713 quit_all_impl(cx.editor, false)