From 837627dd8a9cb8521e0cfa7199771ef2ce7cc465 Mon Sep 17 00:00:00 2001 From: Tatesa Uradnik Date: Mon, 16 Jun 2025 15:19:28 +0200 Subject: [PATCH] feat: allow moving nonexistent file (#13748) --- helix-view/src/editor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index cb9586e79..89f053741 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1437,7 +1437,11 @@ impl Editor { log::error!("failed to apply workspace edit: {err:?}") } } - fs::rename(old_path, &new_path)?; + + if old_path.exists() { + fs::rename(old_path, &new_path)?; + } + if let Some(doc) = self.document_by_path(old_path) { self.set_doc_path(doc.id(), &new_path); }