fix: check file paths on renaming files (#1080)

This commit is contained in:
Yifan Song 2024-12-28 09:56:11 +08:00 committed by GitHub
parent ef4714c195
commit 978e4d6f4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -212,7 +212,9 @@ impl RenameFileWorker<'_> {
let root = LinkedNode::new(ref_src.root());
let edits = edits.entry(uri).or_default();
for obj in &link_info.objects {
if !matches!(obj.target, LinkTarget::Path(..)) {
if !matches!(&obj.target,
LinkTarget::Path(file_id, _) if *file_id == self.def_fid
) {
continue;
}
if let Some(edit) = self.rename_resource_path(obj, &root, &ref_src) {