pub struct EventAction {}Expand description
Links events from ratatui to custom actions.
It mutates Status or its children Tab.
Implementations§
Source§impl EventAction
impl EventAction
Sourcepub fn quit(status: &mut Status) -> Result<()>
pub fn quit(status: &mut Status) -> Result<()>
Once a quit event is received, we change a flag and break the main loop. It’s useful to be able to reset the cursor before leaving the application. If a menu is opened, closes it.
Sourcepub fn refresh_view(status: &mut Status) -> Result<()>
pub fn refresh_view(status: &mut Status) -> Result<()>
Refresh the current view, reloading the files. Move the selection to top.
Sourcepub fn refresh_if_needed(status: &mut Status) -> Result<()>
pub fn refresh_if_needed(status: &mut Status) -> Result<()>
Refresh the views if files were modified in current directory.
pub fn resize(status: &mut Status, width: u16, height: u16) -> Result<()>
Sourcepub fn reset_mode(status: &mut Status) -> Result<()>
pub fn reset_mode(status: &mut Status) -> Result<()>
Leave current mode to normal mode. Reset the inputs and completion, reset the window, exit the preview.
Sourcepub fn toggle_display_full(status: &mut Status) -> Result<()>
pub fn toggle_display_full(status: &mut Status) -> Result<()>
Toggle between a full display (aka ls -lah) or a simple mode (only the filenames).
Sourcepub fn toggle_dualpane(status: &mut Status) -> Result<()>
pub fn toggle_dualpane(status: &mut Status) -> Result<()>
Toggle between dualpane and single pane. Does nothing if the width is too low to display both panes.
Sourcepub fn toggle_preview_second(status: &mut Status) -> Result<()>
pub fn toggle_preview_second(status: &mut Status) -> Result<()>
Toggle the second pane between preview & normal mode (files).
Sourcepub fn tree(status: &mut Status) -> Result<()>
pub fn tree(status: &mut Status) -> Result<()>
Creates a tree in every mode but “Tree”. In display_mode tree it will exit this view.
Sourcepub fn tree_fold(status: &mut Status) -> Result<()>
pub fn tree_fold(status: &mut Status) -> Result<()>
Fold the current node of the tree. Has no effect on “file” nodes.
Sourcepub fn tree_unfold_all(status: &mut Status) -> Result<()>
pub fn tree_unfold_all(status: &mut Status) -> Result<()>
Unfold every child node in the tree. Recursively explore the tree and unfold every node. Reset the display.
Sourcepub fn tree_fold_all(status: &mut Status) -> Result<()>
pub fn tree_fold_all(status: &mut Status) -> Result<()>
Fold every child node in the tree. Recursively explore the tree and fold every node. Reset the display.
Sourcepub fn display_flagged(status: &mut Status) -> Result<()>
pub fn display_flagged(status: &mut Status) -> Result<()>
Toggle the display of flagged files. Does nothing if a menu is opened.
Sourcepub fn preview(status: &mut Status) -> Result<()>
pub fn preview(status: &mut Status) -> Result<()>
Preview the selected file.
Every file can be previewed. See the crate::enum::Preview for
more details on previewinga file.
Does nothing if the directory is empty.
Toggle the display of hidden files.
Sourcepub fn clear_flags(status: &mut Status) -> Result<()>
pub fn clear_flags(status: &mut Status) -> Result<()>
Remove every flag on files in this directory and others.
Sourcepub fn flagged_to_clipboard(status: &mut Status) -> Result<()>
pub fn flagged_to_clipboard(status: &mut Status) -> Result<()>
Push every flagged path to the clipboard.
Sourcepub fn flagged_from_clipboard(status: &mut Status) -> Result<()>
pub fn flagged_from_clipboard(status: &mut Status) -> Result<()>
Replace the currently flagged files by those in clipboard. Does nothing if the clipboard is empty or can’t be read.
Sourcepub fn reverse_flags(status: &mut Status) -> Result<()>
pub fn reverse_flags(status: &mut Status) -> Result<()>
Reverse every flag in current directory. Flagged files in other directory aren’t affected.
Sourcepub fn toggle_flag(status: &mut Status) -> Result<()>
pub fn toggle_flag(status: &mut Status) -> Result<()>
Toggle a single flag and move down one row.
Sourcepub fn rename(status: &mut Status) -> Result<()>
pub fn rename(status: &mut Status) -> Result<()>
Enter the rename mode. Keep a track of the current mode to ensure we rename the correct file. When we enter rename from a “tree” mode, we’ll need to rename the selected file in the tree, not the selected file in the pathcontent.
Sourcepub fn copy_paste(status: &mut Status) -> Result<()>
pub fn copy_paste(status: &mut Status) -> Result<()>
Enter a copy paste mode. A confirmation is asked before copying all flagged files to the current directory. Does nothing if no file is flagged.
Sourcepub fn cut_paste(status: &mut Status) -> Result<()>
pub fn cut_paste(status: &mut Status) -> Result<()>
Enter the ‘move’ mode. A confirmation is asked before moving all flagged files to the current directory. Does nothing if no file is flagged.
Sourcepub fn symlink(status: &mut Status) -> Result<()>
pub fn symlink(status: &mut Status) -> Result<()>
Creates a symlink of every flagged file to the current directory.
Sourcepub fn delete_file(status: &mut Status) -> Result<()>
pub fn delete_file(status: &mut Status) -> Result<()>
Enter the delete mode. A confirmation is then asked before deleting all the flagged files. If no file is flagged, flag the selected one before entering the mode.
Sourcepub fn chmod(status: &mut Status) -> Result<()>
pub fn chmod(status: &mut Status) -> Result<()>
Change to CHMOD mode allowing to edit permissions of a file.
Sourcepub fn open_file(status: &mut Status) -> Result<()>
pub fn open_file(status: &mut Status) -> Result<()>
Open files with custom opener. If there’s no flagged file, the selected is chosen. Otherwise, it will open the flagged files (not the flagged directories) with their respective opener. Directories aren’t opened since it will lead nowhere, it would only replace the current tab multiple times. It may change in the future. Only files which use an external opener are supported.
pub fn open_all(status: &mut Status) -> Result<()>
Sourcepub fn exec(status: &mut Status) -> Result<()>
pub fn exec(status: &mut Status) -> Result<()>
Enter the execute mode. Most commands must be executed to allow for a confirmation.
Sourcepub fn sort(status: &mut Status) -> Result<()>
pub fn sort(status: &mut Status) -> Result<()>
Enter the sort mode, allowing the user to select a sort method.
Sourcepub fn filter(status: &mut Status) -> Result<()>
pub fn filter(status: &mut Status) -> Result<()>
Enter the filter mode, where you can filter.
See crate::modes::Filter for more details.
Sourcepub fn bulk(status: &mut Status) -> Result<()>
pub fn bulk(status: &mut Status) -> Result<()>
Enter bulkrename mode, opening a random temp file where the user can edit the selected filenames. Once the temp file is saved, those file names are changed.
Sourcepub fn search(status: &mut Status) -> Result<()>
pub fn search(status: &mut Status) -> Result<()>
Enter the search mode. Matching items are displayed as you type them.
Sourcepub fn regex_match(status: &mut Status) -> Result<()>
pub fn regex_match(status: &mut Status) -> Result<()>
Enter the regex mode. Every file matching the typed regex will be flagged.
Sourcepub fn help(status: &mut Status, binds: &Bindings) -> Result<()>
pub fn help(status: &mut Status, binds: &Bindings) -> Result<()>
Display the help which can be navigated and displays the configrable binds.
Sourcepub fn cd(status: &mut Status) -> Result<()>
pub fn cd(status: &mut Status) -> Result<()>
Enter the cd mode where an user can type a path to jump to.
Sourcepub fn shell(status: &mut Status) -> Result<()>
pub fn shell(status: &mut Status) -> Result<()>
Open a new terminal in current directory and current window. The shell is a fork of current process and will exit if the application is terminated first.
Sourcepub fn shell_command(status: &mut Status) -> Result<()>
pub fn shell_command(status: &mut Status) -> Result<()>
Enter the shell input command mode. The user can type a command which will be parsed and run.
Enter the shell menu mode. You can pick a TUI application to be run
Enter the cli info mode. You can pick a Text application to be displayed/
Sourcepub fn history(status: &mut Status) -> Result<()>
pub fn history(status: &mut Status) -> Result<()>
Enter the history mode, allowing to navigate to previously visited directory.
Sourcepub fn marks_new(status: &mut Status) -> Result<()>
pub fn marks_new(status: &mut Status) -> Result<()>
Enter Marks new mode, allowing to bind a char to a path.
Sourcepub fn marks_jump(status: &mut Status) -> Result<()>
pub fn marks_jump(status: &mut Status) -> Result<()>
Enter Marks jump mode, allowing to jump to a marked file.
Sourcepub fn temp_marks_jump(status: &mut Status) -> Result<()>
pub fn temp_marks_jump(status: &mut Status) -> Result<()>
Enter TempMarks jump mode, allowing to jump to a marked file.
Sourcepub fn temp_marks_new(status: &mut Status) -> Result<()>
pub fn temp_marks_new(status: &mut Status) -> Result<()>
Enter TempMarks new mode, allowing to bind a char to a path.
Sourcepub fn shortcut(status: &mut Status) -> Result<()>
pub fn shortcut(status: &mut Status) -> Result<()>
Enter the shortcut mode, allowing to visit predefined shortcuts. Basic folders (/, /dev… $HOME) and mount points (even impossible to visit ones) are proposed.
Sourcepub fn nvim_filepicker(status: &mut Status) -> Result<()>
pub fn nvim_filepicker(status: &mut Status) -> Result<()>
Send a signal to parent NVIM process, picking files. If there’s no flagged file, it picks the selected one. otherwise, flagged files are picked. If no RPC server were provided at launch time - which may happen for reasons unknow to me - it does nothing. It requires the “nvim-send” application to be in $PATH.
Sourcepub fn set_nvim_server(status: &mut Status) -> Result<()>
pub fn set_nvim_server(status: &mut Status) -> Result<()>
Enter the set neovim RPC address mode where the user can type the RPC address himself
Sourcepub fn back(status: &mut Status) -> Result<()>
pub fn back(status: &mut Status) -> Result<()>
Move back in history to the last visited directory.
pub fn go_root(status: &mut Status) -> Result<()>
pub fn go_start(status: &mut Status) -> Result<()>
pub fn search_next(status: &mut Status) -> Result<()>
Sourcepub fn move_up(status: &mut Status) -> Result<()>
pub fn move_up(status: &mut Status) -> Result<()>
Move up one row in modes allowing movement. Does nothing if the selected item is already the first in list.
Sourcepub fn next_thing(status: &mut Status) -> Result<()>
pub fn next_thing(status: &mut Status) -> Result<()>
Special move to the next “thing”. if we’re in tree mode, focusing a file, it’s the next sibling (= node of the same level sharing parent) if we’re inputing something, it’s the next history result
Sourcepub fn previous_thing(status: &mut Status) -> Result<()>
pub fn previous_thing(status: &mut Status) -> Result<()>
Special move to the previous “thing”. if we’re in tree mode, focusing a file, it’s the previous sibling (= node of the same level sharing parent) if we’re inputing something, it’s the previous history result
Sourcepub fn move_down(status: &mut Status) -> Result<()>
pub fn move_down(status: &mut Status) -> Result<()>
Move down one row in modes allowing movements. Does nothing if the user is already at the bottom.
Sourcepub fn move_left(status: &mut Status) -> Result<()>
pub fn move_left(status: &mut Status) -> Result<()>
Move to parent in normal mode, move left one char in mode requiring text input.
Sourcepub fn move_right(status: &mut Status) -> Result<()>
pub fn move_right(status: &mut Status) -> Result<()>
Move to child if any or open a regular file in normal mode. Move the cursor one char to right in mode requiring text input.
pub fn focus_follow_mouse(status: &mut Status, row: u16, col: u16) -> Result<()>
Sourcepub fn left_click(
status: &mut Status,
binds: &Bindings,
row: u16,
col: u16,
) -> Result<()>
pub fn left_click( status: &mut Status, binds: &Bindings, row: u16, col: u16, ) -> Result<()>
Left Click a file at row, col. Gives the focus to the window container.
Sourcepub fn right_click(
status: &mut Status,
binds: &Bindings,
row: u16,
col: u16,
) -> Result<()>
pub fn right_click( status: &mut Status, binds: &Bindings, row: u16, col: u16, ) -> Result<()>
Right click gives focus to the window and open the context menu
Sourcepub fn wheel_up(status: &mut Status, row: u16, col: u16) -> Result<()>
pub fn wheel_up(status: &mut Status, row: u16, col: u16) -> Result<()>
Wheel up moves the display up
Sourcepub fn wheel_down(status: &mut Status, row: u16, col: u16) -> Result<()>
pub fn wheel_down(status: &mut Status, row: u16, col: u16) -> Result<()>
Wheel down moves the display down
Sourcepub fn middle_click(
status: &mut Status,
binds: &Bindings,
row: u16,
col: u16,
) -> Result<()>
pub fn middle_click( status: &mut Status, binds: &Bindings, row: u16, col: u16, ) -> Result<()>
A middle_click click opens a file or execute a menu item
Sourcepub fn backspace(status: &mut Status) -> Result<()>
pub fn backspace(status: &mut Status) -> Result<()>
Delete a char to the left in modes allowing edition.
Sourcepub fn delete(status: &mut Status) -> Result<()>
pub fn delete(status: &mut Status) -> Result<()>
When files are focused, try to delete the flagged files (or selected if no file is flagged) When edit window is focused, delete all chars to the right in mode allowing edition.
pub fn delete_line(status: &mut Status) -> Result<()>
Sourcepub fn delete_left(status: &mut Status) -> Result<()>
pub fn delete_left(status: &mut Status) -> Result<()>
Delete one word to the left in menus with input
Sourcepub fn key_home(status: &mut Status) -> Result<()>
pub fn key_home(status: &mut Status) -> Result<()>
Move to leftmost char in mode allowing edition.
Sourcepub fn page_down(status: &mut Status) -> Result<()>
pub fn page_down(status: &mut Status) -> Result<()>
Move down 10 lines in normal & preview mode.
Sourcepub fn enter(status: &mut Status, binds: &Bindings) -> Result<()>
pub fn enter(status: &mut Status, binds: &Bindings) -> Result<()>
Execute the mode. In modes requiring confirmation or text input, it will execute the related action. In normal mode, it will open the file. Reset to normal mode afterwards.
Sourcepub fn tab(status: &mut Status) -> Result<()>
pub fn tab(status: &mut Status) -> Result<()>
Change tab in normal mode with dual pane displayed, insert a completion in modes allowing completion.
Sourcepub fn fuzzyfind_line(status: &mut Status) -> Result<()>
pub fn fuzzyfind_line(status: &mut Status) -> Result<()>
Start a fuzzy find for a specific line with skim.
Sourcepub fn fuzzyfind_help(status: &mut Status, binds: &Bindings) -> Result<()>
pub fn fuzzyfind_help(status: &mut Status, binds: &Bindings) -> Result<()>
Start a fuzzy find for a keybinding with skim.
Sourcepub fn copy_content(status: &Status) -> Result<()>
pub fn copy_content(status: &Status) -> Result<()>
Copy the content of the selected text file in normal mode.
Sourcepub fn copy_filename(status: &Status) -> Result<()>
pub fn copy_filename(status: &Status) -> Result<()>
Copy the filename of the selected file in normal mode.
Sourcepub fn copy_filepath(status: &Status) -> Result<()>
pub fn copy_filepath(status: &Status) -> Result<()>
Copy the filepath of the selected file in normal mode.
Sourcepub fn trash_move_file(status: &mut Status) -> Result<()>
pub fn trash_move_file(status: &mut Status) -> Result<()>
Move flagged files to the trash directory. If no file is flagged, flag the selected file. More information in the trash crate itself. If the file is mounted on the $topdir of the trash (aka the $HOME mount point), it is moved there. Else, nothing is done.
Sourcepub fn trash_empty(status: &mut Status) -> Result<()>
pub fn trash_empty(status: &mut Status) -> Result<()>
Ask the user if he wants to empty the trash. It requires a confimation before doing anything
Sourcepub fn trash_open(status: &mut Status) -> Result<()>
pub fn trash_open(status: &mut Status) -> Result<()>
Open the trash. Displays a navigable content of the trash. Each item can be restored or deleted. Each opening refresh the trash content.
pub fn trash_restore(status: &mut Status) -> Result<()>
Sourcepub fn open_config(status: &mut Status) -> Result<()>
pub fn open_config(status: &mut Status) -> Result<()>
Open the config file.
Sourcepub fn context(status: &mut Status) -> Result<()>
pub fn context(status: &mut Status) -> Result<()>
Enter the context menu mode where the user can choose a basic file action.
Sourcepub fn action(status: &mut Status) -> Result<()>
pub fn action(status: &mut Status) -> Result<()>
Enter action mode in which you can type any valid action. Some action does nothing as they require to be executed from a specific context.
Sourcepub fn custom(status: &mut Status, input_string: &str) -> Result<()>
pub fn custom(status: &mut Status, input_string: &str) -> Result<()>
Execute a custom event on the selected file
Sourcepub fn remote_mount(status: &mut Status) -> Result<()>
pub fn remote_mount(status: &mut Status) -> Result<()>
Enter the remote mount mode where the user can provide an username, an adress and a mount point to mount a remote device through SSHFS.
pub fn cloud_drive(status: &mut Status) -> Result<()>
Sourcepub fn select_pane(status: &mut Status, col: u16) -> Result<()>
pub fn select_pane(status: &mut Status, col: u16) -> Result<()>
Select the left or right tab depending on col
pub fn focus_go_left(status: &mut Status) -> Result<()>
pub fn focus_go_right(status: &mut Status) -> Result<()>
pub fn focus_go_down(status: &mut Status) -> Result<()>
pub fn focus_go_up(status: &mut Status) -> Result<()>
pub fn sync_ltr(status: &mut Status) -> Result<()>
pub fn bulk_confirm(status: &mut Status) -> Result<()>
pub fn file_copied(status: &mut Status) -> Result<()>
pub fn display_copy_progress( status: &mut Status, content: InMemoryTerm, ) -> Result<()>
pub fn check_preview_fuzzy_tick(status: &mut Status) -> Result<()>
pub fn visual(status: &mut Status) -> Result<()>
Auto Trait Implementations§
impl Freeze for EventAction
impl RefUnwindSafe for EventAction
impl Send for EventAction
impl Sync for EventAction
impl Unpin for EventAction
impl UnwindSafe for EventAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more