From 143e5b628ef7d6cf9bba8f572df7b4e7ce22dc60 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 17 Feb 2019 20:58:28 +0300 Subject: remove overlay removes overlay --- crates/ra_vfs/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs index ddbc38163..7e45f0a73 100644 --- a/crates/ra_vfs/src/lib.rs +++ b/crates/ra_vfs/src/lib.rs @@ -143,7 +143,7 @@ impl Vfs { let file = file.expect("can't remove a file which wasn't added"); let full_path = rel_path.to_path(&self.roots.path(root)); if let Ok(text) = fs::read_to_string(&full_path) { - self.do_change_file(file, text, true); + self.do_change_file(file, text, false); } else { self.do_remove_file(root, rel_path, file); } @@ -183,11 +183,11 @@ impl Vfs { self.pending_changes.push(change); } TaskResult::SingleFile { root, path, text } => { - let file = self.find_file(root, &path); - if file.map(|file| self.files[file].is_overlayed) == Some(true) { + let existing_file = self.find_file(root, &path); + if existing_file.map(|file| self.files[file].is_overlayed) == Some(true) { return; } - match (file, text) { + match (existing_file, text) { (Some(file), None) => { self.do_remove_file(root, path, file); } -- cgit v1.2.3