mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
remove overlay removes overlay
This commit is contained in:
@@ -143,7 +143,7 @@ pub fn remove_file_overlay(&mut self, path: &Path) -> Option<VfsFile> {
|
||||
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 @@ pub fn handle_task(&mut self, task: io::TaskResult) {
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user