From 418ee17b86c24f03699659f4aa91b331a68e5666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 7 May 2021 14:30:23 +0900 Subject: [PATCH] Canonicalize the path on open to avoid duplicates. --- helix-view/src/editor.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index e9f027f36..84d499e30 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -119,6 +119,8 @@ impl Editor { } pub fn open(&mut self, path: PathBuf, action: Action) -> Result { + let path = std::fs::canonicalize(path)?; + let id = self .documents() .find(|doc| doc.path() == Some(&path))