Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index aa9a1153..4fc3f470 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -1718,10 +1718,14 @@ impl Editor {
Ok(doc_id)
}
+ pub fn document_id_by_path(&self, path: &Path) -> Option<DocumentId> {
+ self.document_by_path(path).map(|doc| doc.id)
+ }
+
// ??? possible use for integration tests
pub fn open(&mut self, path: &Path, action: Action) -> Result<DocumentId, DocumentOpenError> {
let path = helix_stdx::path::canonicalize(path);
- let id = self.document_by_path(&path).map(|doc| doc.id);
+ let id = self.document_id_by_path(&path);
let id = if let Some(id) = id {
id