aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/compositor.rs
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-08-24 05:13:41 +0000
committerSkyler Hawthorne2022-10-19 02:31:39 +0000
commit57de4e62519a59aece104867569c2b9ad044af54 (patch)
tree8ab5a88dbdad6f64073aae48a49d13f996ad83eb /helix-term/src/compositor.rs
parent7b11e9ac6941188c6f6148961fdd97e34988490e (diff)
various fixes in write-all path
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r--helix-term/src/compositor.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index 6ef77341..5077807d 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -29,17 +29,17 @@ pub struct Context<'a> {
impl<'a> Context<'a> {
/// Waits on all pending jobs, and then tries to flush all pending write
- /// operations for the current document.
+ /// operations for all documents.
pub fn block_try_flush_writes(&mut self) -> anyhow::Result<()> {
tokio::task::block_in_place(|| {
helix_lsp::block_on(self.jobs.finish(Some(self.editor), None))
})?;
- let doc = doc_mut!(self.editor);
-
- tokio::task::block_in_place(|| helix_lsp::block_on(doc.try_flush_saves()))
- .map(|result| result.map(|_| ()))
- .unwrap_or(Ok(()))?;
+ for doc in &mut self.editor.documents.values_mut() {
+ tokio::task::block_in_place(|| helix_lsp::block_on(doc.try_flush_saves()))
+ .map(|result| result.map(|_| ()))
+ .unwrap_or(Ok(()))?;
+ }
Ok(())
}