diff options
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/editor.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index c4789ee2..c0efad05 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1348,4 +1348,19 @@ impl Editor { } } } + + pub async fn flush_writes(&mut self) { + while let Some(save_event) = self.save_queue.next().await { + match &save_event { + Ok(event) => { + let doc = doc_mut!(self, &event.doc_id); + doc.set_last_saved_revision(event.revision); + } + Err(err) => { + log::error!("error saving document: {}", err); + } + }; + // TODO: if is_err: break? + } + } } |