mirror of
https://github.com/oxalica/nil.git
synced 2024-11-23 12:03:30 +03:00
Fix lost root changes
This commit is contained in:
parent
4216d2a60d
commit
eb71b56015
@ -64,6 +64,7 @@ impl Vfs {
|
|||||||
self.change.change_file(file, text);
|
self.change.change_file(file, text);
|
||||||
if !is_valid {
|
if !is_valid {
|
||||||
self.local_file_set.remove_file(file);
|
self.local_file_set.remove_file(file);
|
||||||
|
self.root_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
@ -72,6 +73,7 @@ impl Vfs {
|
|||||||
}
|
}
|
||||||
let file = FileId(u32::try_from(self.files.len()).expect("Length overflow"));
|
let file = FileId(u32::try_from(self.files.len()).expect("Length overflow"));
|
||||||
self.local_file_set.insert(file, path);
|
self.local_file_set.insert(file, path);
|
||||||
|
self.root_changed = true;
|
||||||
self.files.push((text.clone(), line_map));
|
self.files.push((text.clone(), line_map));
|
||||||
self.change.change_file(file, text);
|
self.change.change_file(file, text);
|
||||||
}
|
}
|
||||||
@ -120,8 +122,7 @@ impl Vfs {
|
|||||||
|
|
||||||
pub fn take_change(&mut self) -> Change {
|
pub fn take_change(&mut self) -> Change {
|
||||||
let mut change = mem::take(&mut self.change);
|
let mut change = mem::take(&mut self.change);
|
||||||
if self.root_changed {
|
if mem::take(&mut self.root_changed) {
|
||||||
self.root_changed = false;
|
|
||||||
// TODO: Configurable.
|
// TODO: Configurable.
|
||||||
let entry = ["/flake.nix", "/default.nix"].iter().find_map(|&path| {
|
let entry = ["/flake.nix", "/default.nix"].iter().find_map(|&path| {
|
||||||
let path = VfsPath::new(path).unwrap();
|
let path = VfsPath::new(path).unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user