diff options
author | Skyler Hawthorne | 2022-04-23 22:38:55 +0000 |
---|---|---|
committer | Skyler Hawthorne | 2022-10-19 02:31:38 +0000 |
commit | a5a93182cd5ccf88bc95b68044aa05d746ded35e (patch) | |
tree | 14e7d73c9f0b4f0c969f487165c56ab4402fbebd /helix-view/src/editor.rs | |
parent | d706194597d462fbaeb1ef55e2e8fb6eae38d2f3 (diff) |
fix: buffer-close ensuring writes
Make sure buffer-close waits for the document to finish its writes.
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r-- | helix-view/src/editor.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index ec6119a4..e038a82d 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1101,6 +1101,11 @@ impl Editor { None => return Err(CloseError::DoesNotExist), }; + // flush out any pending writes first to clear the modified status + if let Some(save_result) = doc.try_flush_saves().await { + save_result?; + } + if !force && doc.is_modified() { return Err(CloseError::BufferModified(doc.display_name().into_owned())); } |