From b0212b36118f7a4d596510dabb0c011144c7af69 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sun, 16 Oct 2022 18:01:31 +0900 Subject: Deduplicate flush_writes --- helix-term/src/commands/typed.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'helix-term/src/commands/typed.rs') diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index ef774256..c18f3c39 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -80,22 +80,7 @@ fn buffer_close_by_ids_impl( force: bool, ) -> anyhow::Result<()> { // TODO: deduplicate with ctx.block_try_flush_writes - tokio::task::block_in_place(|| { - helix_lsp::block_on(async { - while let Some(save_event) = editor.save_queue.next().await { - match &save_event { - Ok(event) => { - let doc = doc_mut!(editor, &event.doc_id); - doc.set_last_saved_revision(event.revision); - } - Err(err) => { - log::error!("error saving document: {}", err); - } - }; - // TODO: if is_err: break? - } - }) - }); + tokio::task::block_in_place(|| helix_lsp::block_on(editor.flush_writes())); let (modified_ids, modified_names): (Vec<_>, Vec<_>) = doc_ids .iter() -- cgit v1.2.3-70-g09d2