on master help sign in
Canonicalize the path on open to avoid duplicates.
418ee17Blaž Hrastnik
helix-view/src/editor.rs+2
@@ -119,6 +119,8 @@ impl Editor {
119 }
119 }
120
120
121 pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Error> {
121 pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Error> {
122+ let path = std::fs::canonicalize(path)?;
123+
122 let id = self
124 let id = self
123 .documents()
125 .documents()
124 .find(|doc| doc.path() == Some(&path))
126 .find(|doc| doc.path() == Some(&path))