diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-06-04 16:55:36 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-06-04 16:59:39 -0400 |
commit | 97a1b5a9ad52f1d706b02ab6c7cd019da9a124b9 (patch) | |
tree | 2f407ff91aaa6595626e1904430fb0ba44f6d630 /src/preview.rs | |
parent | fd4bd6f79ec8051c91f69543fc20d5e8d6607f13 (diff) |
change pub fields to private and rename structs to io
Diffstat (limited to 'src/preview.rs')
-rw-r--r-- | src/preview.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/preview.rs b/src/preview.rs index 982dcf8..ede388d 100644 --- a/src/preview.rs +++ b/src/preview.rs @@ -4,7 +4,7 @@ use std::path; use std::process; use crate::config::{JoshutoConfig, JoshutoPreviewEntry}; -use crate::structs::{JoshutoDirEntry, JoshutoDirList}; +use crate::io::{JoshutoDirEntry, JoshutoDirList}; use crate::tab::JoshutoTab; use crate::ui; use crate::window::panel::JoshutoPanel; @@ -22,8 +22,13 @@ pub fn preview_parent(curr_tab: &mut JoshutoTab, win: &JoshutoPanel, config_t: & pub fn preview_entry(curr_tab: &mut JoshutoTab, win: &JoshutoPanel, config_t: &JoshutoConfig) { ncurses::werase(win.win); if let Some(s) = curr_tab.curr_list.get_curr_ref() { - if s.path.is_dir() { - preview_directory(&mut curr_tab.history, s.path.as_path(), win, config_t); + if s.file_path().is_dir() { + preview_directory( + &mut curr_tab.history, + s.file_path().as_path(), + win, + config_t, + ); } else if s.metadata.file_type.is_file() { if s.metadata.len <= config_t.max_preview_size { // preview_file(s, win); @@ -67,7 +72,7 @@ fn preview_directory( } fn preview_file(entry: &JoshutoDirEntry, win: &JoshutoPanel) { - let path = &entry.path; + let path = entry.file_path(); match path.extension() { Some(file_ext) => match PREVIEW_T.extension.get(file_ext.to_str().unwrap()) { Some(s) => preview_with(path, win, &s), |