1
0
mirror of https://github.com/helix-editor/helix synced 2024-09-21 00:34:57 +02:00

Canonicalize the path on open to avoid duplicates.

This commit is contained in:
Blaž Hrastnik 2021-05-07 14:30:23 +09:00
parent 7c915dc065
commit 418ee17b86

View File

@ -119,6 +119,8 @@ impl Editor {
}
pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Error> {
let path = std::fs::canonicalize(path)?;
let id = self
.documents()
.find(|doc| doc.path() == Some(&path))