Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-04-23 11:37:23 -06:00
co-authored by Max Brunsfeld
parent ec2e1c3045
commit c9d7249305
8 changed files with 176 additions and 171 deletions
+5 -5
View File
@@ -18,7 +18,7 @@ use crate::{
worktree::FileHandle,
};
use anyhow::{anyhow, Result};
use gpui::{AppContext, Entity, ModelContext};
use gpui::{Entity, ModelContext};
use lazy_static::lazy_static;
use rand::prelude::*;
use std::{
@@ -26,7 +26,7 @@ use std::{
hash::BuildHasher,
iter::{self, Iterator},
ops::{AddAssign, Range},
path::PathBuf,
path::Path,
str,
sync::Arc,
time::{Duration, Instant},
@@ -429,11 +429,11 @@ impl Buffer {
}
}
pub fn path(&self, app: &AppContext) -> Option<PathBuf> {
self.file.as_ref().map(|file| file.path(app))
pub fn path(&self) -> Option<&Arc<Path>> {
self.file.as_ref().map(|file| file.path())
}
pub fn entry_id(&self) -> Option<(usize, u64)> {
pub fn entry_id(&self) -> Option<(usize, Arc<Path>)> {
self.file.as_ref().map(|file| file.entry_id())
}