diff options
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/files.rs b/src/files.rs index a191873..a5b9b46 100644 --- a/src/files.rs +++ b/src/files.rs @@ -24,11 +24,13 @@ use crate::fail::{HResult, HError, ErrorLog}; use crate::dirty::{AsyncDirtyBit, DirtyBit, Dirtyable}; use crate::preview::{Async, Stale}; use crate::widget::Events; +use crate::icon::Icons; lazy_static! { static ref COLORS: LsColors = LsColors::from_env().unwrap_or_default(); static ref TAGS: RwLock<(bool, Vec<PathBuf>)> = RwLock::new((false, vec![])); + static ref ICONS: Icons = Icons::new(); } fn make_pool(sender: Option<Sender<Events>>) -> ThreadPool { @@ -1010,6 +1012,10 @@ impl File { Some(time.format("%F %R").to_string()) } + pub fn icon(&self) -> &'static str { + ICONS.get(&self.path) + } + pub fn short_path(&self) -> PathBuf { self.path.short_path() } |