diff options
author | Aleksey Kladov <[email protected]> | 2019-02-17 17:58:28 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-17 17:58:28 +0000 |
commit | 143e5b628ef7d6cf9bba8f572df7b4e7ce22dc60 (patch) | |
tree | d60d6056fee7a38853a760839f684aae3ab50371 /crates/ra_vfs/src | |
parent | e8bc29f122813bb3c69d1f8cd60dd6ab4dd9a4bf (diff) |
remove overlay removes overlay
Diffstat (limited to 'crates/ra_vfs/src')
-rw-r--r-- | crates/ra_vfs/src/lib.rs | 8 |
1 files 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 { | |||
143 | let file = file.expect("can't remove a file which wasn't added"); | 143 | let file = file.expect("can't remove a file which wasn't added"); |
144 | let full_path = rel_path.to_path(&self.roots.path(root)); | 144 | let full_path = rel_path.to_path(&self.roots.path(root)); |
145 | if let Ok(text) = fs::read_to_string(&full_path) { | 145 | if let Ok(text) = fs::read_to_string(&full_path) { |
146 | self.do_change_file(file, text, true); | 146 | self.do_change_file(file, text, false); |
147 | } else { | 147 | } else { |
148 | self.do_remove_file(root, rel_path, file); | 148 | self.do_remove_file(root, rel_path, file); |
149 | } | 149 | } |
@@ -183,11 +183,11 @@ impl Vfs { | |||
183 | self.pending_changes.push(change); | 183 | self.pending_changes.push(change); |
184 | } | 184 | } |
185 | TaskResult::SingleFile { root, path, text } => { | 185 | TaskResult::SingleFile { root, path, text } => { |
186 | let file = self.find_file(root, &path); | 186 | let existing_file = self.find_file(root, &path); |
187 | if file.map(|file| self.files[file].is_overlayed) == Some(true) { | 187 | if existing_file.map(|file| self.files[file].is_overlayed) == Some(true) { |
188 | return; | 188 | return; |
189 | } | 189 | } |
190 | match (file, text) { | 190 | match (existing_file, text) { |
191 | (Some(file), None) => { | 191 | (Some(file), None) => { |
192 | self.do_remove_file(root, path, file); | 192 | self.do_remove_file(root, path, file); |
193 | } | 193 | } |