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/application.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'helix-term/src/application.rs') diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 6010e745..719683bf 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -1,5 +1,5 @@ use arc_swap::{access::Map, ArcSwap}; -use futures_util::{Stream, StreamExt}; +use futures_util::Stream; use helix_core::{ diagnostic::{DiagnosticTag, NumberOrString}, path::get_relative_path, @@ -969,22 +969,7 @@ impl Application { let mut errs = Vec::new(); // TODO: deduplicate with ctx.block_try_flush_writes - tokio::task::block_in_place(|| { - helix_lsp::block_on(async { - while let Some(save_event) = self.editor.save_queue.next().await { - match &save_event { - Ok(event) => { - let doc = doc_mut!(self.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(self.editor.flush_writes())); if let Err(err) = self .jobs -- cgit v1.2.3-70-g09d2