Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index a0a56113..2fff2347 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -980,6 +980,7 @@ impl Document {
// mark changes up to now as saved
let current_rev = self.get_current_revision();
let doc_id = self.id();
+ let atomic_save = self.config.load().atomic_save;
let encoding_with_bom_info = (self.encoding, self.has_bom);
let last_saved_time = self.last_saved_time;
@@ -1029,7 +1030,7 @@ impl Document {
// Assume it is a hardlink to prevent data loss if the metadata cant be read (e.g. on certain Windows configurations)
let is_hardlink = helix_stdx::faccess::hardlink_count(&write_path).unwrap_or(2) > 1;
- let backup = if path.exists() {
+ let backup = if path.exists() && atomic_save {
let path_ = write_path.clone();
// hacks: we use tempfile to handle the complex task of creating
// non clobbered temporary path for us we don't want