Struct fm::event_exec::EventExec

source ·
pub struct EventExec {}
Expand description

Every kind of mutation of the application is defined here. It mutates Status or its children Tab.

Implementations§

Reset the selected tab view to the default.

When a rezise event occurs, we may hide the second panel if the width isn’t sufficiant to display enough information. We also need to know the new height of the terminal to start scrolling up or down.

Remove every flag on files in this directory and others.

Flag all files in the current directory.

Reverse every flag in current directory. Flagged files in other directory aren’t affected.

Toggle a single flag and move down one row.

Move to the next file in the jump list.

Move to the previous file in the jump list.

Change to CHMOD mode allowing to edit permissions of a file.

Enter JUMP mode, allowing to jump to any flagged file. Does nothing if no file is flagged.

Enter Marks new mode, allowing to bind a char to a path.

Enter Marks jump mode, allowing to jump to a marked file.

Execute a new mark, saving it to a config file for futher use.

Execute a jump to a mark, moving to a valid path. If the saved path is invalid, it does nothing but reset the view.

Creates a symlink of every flagged file to the current directory.

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.

Copy the flagged file to current directory. A progress bar is displayed and a notification is sent once it’s done.

Move the flagged file to current directory. A progress bar is displayed and a notification is sent once it’s done.

Recursively delete all flagged files.

Change permission of the flagged files. Once the user has typed an octal permission like 754, it’s applied to the file. Nothing is done if the user typed nothing or an invalid permission like 955.

Execute a jump to the selected flagged file. If the user selected a directory, we jump inside it. Otherwise, we jump to the parent and select the file.

Execute a command requiring a confirmation (Delete, Move or Copy).

Select the first file matching the typed regex in current dir.

Leave current mode to normal mode. Reset the inputs and completion, reset the window, exit the preview.

Move up one row if possible.

Move down one row if possible.

Move to the top of the current directory.

Move up 10 rows in normal mode. In other modes where vertical scrolling is possible (atm Preview), if moves up one page.

Move down 10 rows in normal mode. In other modes where vertical scrolling is possible (atm Preview), if moves down one page.

Move to the bottom of current view.

Move the cursor to the start of line.

Move the cursor to the end of line.

Select a given row, if there’s something in it.

Select the next shortcut.

Select the previous shortcut.

Select the next element in history of visited files. Watchout! Since the history is displayed in reverse order, we call the “prev” method of the History instance instead.

Select the previous element in history of visited files. Watchout! Since the history is displayed in reverse order, we call the “next” method of the History instance instead.

Move to parent directory if there’s one. Does Add the starting directory to history.

Move the cursor left one block.

Open the file with configured opener or enter the directory.

Move the cursor to the right in input string.

Delete the char to the left in input string.

Delete all chars right of the cursor in input string.

Add a char to input string, look for a possible completion.

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.

Enter the ‘move’ mode. A confirmation is asked before moving all flagged files to the current directory. Does nothing if no file is flagged.

Enter the new dir mode.

Enter the new file mode.

Enter the execute mode. Most commands must be executed to allow for a confirmation.

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.

Enter the delete mode. A confirmation is then asked before deleting all the flagged files. Does nothing is no file is flagged.

Display the help which can be navigated and displays the configrable binds.

Enter the search mode. Matching items are displayed as you type them.

Enter the regex mode. Every file matching the typed regex will be flagged.

Enter the sort mode, allowing the user to select a sort method.

Once a quit event is received, we change a flag and break the main loop. It’s usefull to reset the cursor before leaving the application.

Reset the mode to normal.

Sort the file with given criteria Valid kind of sorts are : by kind : directory first, files next, in alphanumeric order by filename, by date of modification, by size, by extension. The first letter is used to identify the method. If the user types an uppercase char, the sort is reverse.

Insert a char in the input string.

Toggle the display of hidden files.

Open a file with custom opener.

Enter the rename mode.

Enter the goto mode where an user can type a path to jump to.

Open a new terminal in current directory. The shell is a fork of current process and will exit if the application is terminated first.

Enter the history mode, allowing to navigate to previously visited directory.

Enter the shortcut mode, allowing to visit predefined shortcuts. Basic folders (/, /dev… $HOME) and mount points (even impossible to visit ones) are proposed.

A right click opens a file or a directory.

Replace the input string by the selected completion.

Send a signal to parent NVIM process, picking the selected file. 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.

Copy the selected filename to the clipboard. Only the filename.

Copy the selected filepath to the clipboard. The absolute path.

Enter the filter mode, where you can filter. See crate::filter::Filter for more details.

Move back in history to the last visited directory.

Move to $HOME aka ~.

Execute a rename of the selected file. It uses the fs::rename function and has the same limitations. We only tries to rename in the same directory, so it shouldn’t be a problem. Filename is sanitized before processing.

Creates a new file with input string as name. We use fs::File::create internally, so if the file already exists, it will be overwritten. Filename is sanitized before processing.

Creates a new directory with input string as name. We use fs::create_dir internally so it will fail if the input string is not an end point in the file system. ie. the user can create newdir but not newdir/newfolder. It will also fail if the directory already exists. Directory name is sanitized before processing.

Tries to execute the selected file with an executable which is read from the input string. It will fail silently if the executable can’t be found. Optional parameters can be passed normally. ie. "ls -lah"

Executes a dragon-drop command on the selected file. It obviously requires the dragon-drop command to be installed.

Executes a search in current folder, selecting the first file matching the current completion proposition. ie. If you typed "jpg" before, it will move to the first file whose filename contains "jpg". The current order of files is used.

Move to the folder typed by the user. The first completion proposition is used, ~ expansion is done. If no result were found, no cd is done and we go back to normal mode silently.

Move to the selected shortcut. It may fail if the user has no permission to visit the path.

Move back to a previously visited path. It may fail if the user has no permission to visit the path

Apply a filter to the displayed files. See crate::filter for more details.

Move up one row in modes allowing movement. Does nothing if the selected item is already the first in list.

Move down one row in modes allowing movements. Does nothing if the user is already at the bottom.

Move to parent in normal mode, move left one char in mode requiring text input.

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.

Delete a char to the left in modes allowing edition.

Delete all chars to the right in mode allowing edition.

Move to leftmost char in mode allowing edition.

Move to the bottom in any mode.

Move up 10 lines in normal mode and preview.

Move down 10 lines in normal & preview mode.

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.

Change tab in normal mode with dual pane displayed, insert a completion in modes allowing completion.

Change tab in normal mode.

Start a fuzzy find with skim. ATM idk how to avoid using the whole screen.

Copy the filename of the selected file in normal mode.

Copy the filepath of the selected file in normal mode.

Refresh the current view, reloading the files. Move the selection to top.

Open a thumbnail of an image, scaled up to the whole window.

Toggle between a full display (aka ls -lah) or a simple mode (only the filenames).

Toggle between dualpane and single pane. Does nothing if the width is too low to display both panes.

Move flagged files to the trash directory. 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.

Restore a file from the trash if possible. Parent folders are created on the file if needed.

Ask the user if he wants to empty the trash. It requires a confimation before doing anything

Empty the trash folder permanently.

Open the trash. Displays a navigable content of the trash. Each item can be restored or deleted. Each opening refresh the trash content.

Select the next element in the trash folder

Select the previous element in the trash folder

Remove the selected element in the trash folder.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more