pub struct Tab {Show 13 fields
pub mode: Mode,
pub window: ContentWindow,
pub input: Input,
pub path_content: PathContent,
pub height: usize,
pub show_hidden: bool,
pub nvim_server: String,
pub completion: Completion,
pub must_quit: bool,
pub preview: Preview,
pub history: History,
pub shortcut: Shortcut,
pub searched: Option<String>,
}Expand description
Holds every thing about the current tab of the application. Most of the mutation is done externally.
Fields§
§mode: ModeThe mode the application is currenty in
window: ContentWindowThe indexes of displayed file
input: InputFiles marked as flagged
path_content: PathContentFiles in current path
height: usizeHeight of the terminal window
read from command line
nvim_server: StringNVIM RPC server address
completion: CompletionCompletion list and index in it.
must_quit: boolTrue if the user issued a quit event (Key::Char('q') by default).
It’s used to exit the main loop before reseting the cursor.
preview: PreviewLines of the previewed files. Empty if not in preview mode.
history: HistoryVisited directories
shortcut: ShortcutPredefined shortcuts
searched: Option<String>Last searched string
Implementations§
source§impl Tab
impl Tab
sourcepub fn new(
args: Args,
height: usize,
users_cache: Rc<UsersCache>
) -> FmResult<Self>
pub fn new(
args: Args,
height: usize,
users_cache: Rc<UsersCache>
) -> FmResult<Self>
Creates a new tab from args and height.
sourcepub fn fill_completion(&mut self) -> FmResult<()>
pub fn fill_completion(&mut self) -> FmResult<()>
Fill the input string with the currently selected completion.
sourcepub fn refresh_view(&mut self) -> FmResult<()>
pub fn refresh_view(&mut self) -> FmResult<()>
Refresh the current view. Input string is emptied, the files are read again, the window of displayed files is reset. The first file is selected.
sourcepub fn go_to_child(&mut self) -> FmResult<()>
pub fn go_to_child(&mut self) -> FmResult<()>
Move to the currently selected directory. Fail silently if the current directory is empty or if the selected file isn’t a directory.
sourcepub fn set_height(&mut self, height: usize)
pub fn set_height(&mut self, height: usize)
Set the height of the window and itself.
sourcepub fn must_quit(&self) -> bool
pub fn must_quit(&self) -> bool
Returns true iff the application has to quit.
This methods allows use to reset the cursors and other
terminal parameters gracefully.
sourcepub fn set_pathcontent(&mut self, path: &Path) -> FmResult<()>
pub fn set_pathcontent(&mut self, path: &Path) -> FmResult<()>
Set the pathcontent to a new path. Reset the window. Add the last path to the history of visited paths.
sourcepub fn set_window(&mut self)
pub fn set_window(&mut self)
Set the window. Doesn’t require the lenght to be known.
sourcepub fn find_jump_index(&self, jump_target: &Path) -> Option<usize>
pub fn find_jump_index(&self, jump_target: &Path) -> Option<usize>
Returns the correct index jump target to a flagged files.
sourcepub fn refresh_shortcuts(&mut self, mount_points: &[&Path])
pub fn refresh_shortcuts(&mut self, mount_points: &[&Path])
Refresh the shortcuts. It drops non “hardcoded” shortcuts and extend the vector with the mount points.
pub fn go_to_index(&mut self, index: usize)
sourcepub fn refresh_users(&mut self, users_cache: Rc<UsersCache>) -> FmResult<()>
pub fn refresh_users(&mut self, users_cache: Rc<UsersCache>) -> FmResult<()>
Refresh the existing users.