mirror of https://github.com/helix-editor/helix
Canonicalize the path on open to avoid duplicates.
parent
7c915dc065
commit
418ee17b86
|
@ -119,6 +119,8 @@ impl Editor {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Error> {
|
pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Error> {
|
||||||
|
let path = std::fs::canonicalize(path)?;
|
||||||
|
|
||||||
let id = self
|
let id = self
|
||||||
.documents()
|
.documents()
|
||||||
.find(|doc| doc.path() == Some(&path))
|
.find(|doc| doc.path() == Some(&path))
|
||||||
|
|
Loading…
Reference in New Issue