Start work on opening files
This commit is contained in:
@@ -18,11 +18,12 @@ use crate::{
|
||||
worktree::FileHandle,
|
||||
};
|
||||
use anyhow::{anyhow, Result};
|
||||
use gpui::{Entity, ModelContext};
|
||||
use gpui::{AppContext, Entity, ModelContext};
|
||||
use lazy_static::lazy_static;
|
||||
use rand::prelude::*;
|
||||
use std::{
|
||||
cmp,
|
||||
ffi::OsString,
|
||||
hash::BuildHasher,
|
||||
iter::{self, Iterator},
|
||||
ops::{AddAssign, Range},
|
||||
@@ -447,6 +448,10 @@ impl Buffer {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn file_name(&self, ctx: &AppContext) -> Option<OsString> {
|
||||
self.file.as_ref().and_then(|file| file.file_name(ctx))
|
||||
}
|
||||
|
||||
pub fn path(&self) -> Option<Arc<Path>> {
|
||||
self.file.as_ref().map(|file| file.path())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user