pub enum Action {
Show 53 variants
MoveDown,
MoveUp,
JumpTop,
JumpBottom,
EnterOrOpen,
GoParent,
HistoryBack,
HistoryForward,
ReturnFromJump,
Refresh,
ToggleHidden,
SetSortBy(SortBy),
ToggleSortReverse,
ToggleDirsFirst,
CycleEntryDetails,
PreviewScrollDown,
PreviewScrollUp,
PreviewPageDown,
PreviewPageUp,
PreviewScrollTop,
PreviewScrollBottom,
EnterSearch,
EnterCommand,
ExitMode,
SearchAppendChar(char),
SearchDeleteChar,
SearchMoveDown,
SearchMoveUp,
SearchConfirm,
CommandKey(KeyEvent),
RepeatLastCommand,
ExecuteCommand(ParsedCommand),
CopyAbsPath,
CopyRelPath,
CopyFilename,
CopyContent,
BeginDelete,
ConfirmDelete,
CancelDelete,
ToggleMark,
ClearMarks,
PasteMarks(TransferKind),
EnterVisual,
CommitVisual(Option<Box<Action>>),
SetPendingNavKey(char),
RunExternal {
argv: Vec<String>,
cwd: PathBuf,
pause: ShellPause,
label: Option<String>,
},
Quit,
Cancel,
OpenWithOs,
NewTab,
CloseTab,
SwitchTabNext,
SwitchTabPrev,
}Expand description
Every user-initiated state change is represented as one of these variants.
Phase 1 implements the navigation actions; Phase 2 the search actions; Phase 3 adds filesystem mutations, clipboard, and command execution.
Variants§
MoveDown
Move the selection cursor down one row.
MoveUp
Move the selection cursor up one row.
JumpTop
Jump the selection to the first entry.
JumpBottom
Jump the selection to the last entry.
EnterOrOpen
Enter the selected directory, or open the selected file in the configured
editor. For directories this is handled synchronously in apply; for
files it returns Action::RunExternal via the apply_enter_or_open
helper so the event loop can call shell_exec::run_external on the
async path.
GoParent
Navigate to the parent directory.
HistoryBack
Navigate back in the directory history (u).
HistoryForward
Navigate forward in the directory history (Ctrl-r).
ReturnFromJump
Return to where the newest jump (:jump) was made from (U),
skipping the directories visited since.
Refresh
Reload the current directory listing.
ToggleHidden
Toggle visibility of hidden files.
SetSortBy(SortBy)
Re-order the active tab’s listing by the given key.
ToggleSortReverse
Flip the active tab’s listing order.
ToggleDirsFirst
Toggle whether directories are grouped ahead of files in the active tab.
CycleEntryDetails
Step the details column through none → size → modified → both → none.
PreviewScrollDown
Scroll the preview pane down one line, leaving the selection alone.
PreviewScrollUp
Scroll the preview pane up one line, leaving the selection alone.
PreviewPageDown
Scroll the preview pane down one screenful (less a two-line overlap).
PreviewPageUp
Scroll the preview pane up one screenful (less a two-line overlap).
PreviewScrollTop
Scroll the preview pane back to its first line.
PreviewScrollBottom
Scroll the preview pane to the last loaded line, which is the end of the file only when the preview is not truncated.
EnterSearch
Enter Search Mode (Phase 2 wires the actual filter logic).
EnterCommand
Enter Command Mode (Phase 3 wires the actual command parser).
ExitMode
Exit the current mode, returning to Navigation.
SearchAppendChar(char)
Append char to the Search Mode query and re-run the fuzzy filter.
SearchDeleteChar
Delete the last character from the Search Mode query and re-run the fuzzy filter. No-op if the query is already empty.
SearchMoveDown
Move the filtered-list selection down by one row.
SearchMoveUp
Move the filtered-list selection up by one row.
SearchConfirm
Confirm the current filtered selection: enter a directory or leave Search Mode if the selected entry is a file (file open is Phase 6).
CommandKey(KeyEvent)
Feed a single key event into the Command Mode buffer.
RepeatLastCommand
Do the last file operation again (@): the newest :/! command, or
dd, pp or pm, whichever came last — see Repeatable. Like
Vim’s ., it acts on whatever is selected — or marked — now.
ExecuteCommand(ParsedCommand)
Execute a validated, parsed command (dispatched after Command Mode submit).
CopyAbsPath
Copy the absolute path of the selected entry to the yank buffer.
CopyRelPath
Copy the relative path of the selected entry to the yank buffer.
CopyFilename
Copy the filename of the selected entry to the yank buffer.
CopyContent
Copy the content of the selected entry to the yank buffer: the text of a file, or the listing of a directory.
BeginDelete
Begin the dd delete flow — sets pending_delete = true.
ConfirmDelete
Confirm and execute the pending delete.
CancelDelete
Cancel the pending delete confirmation.
ToggleMark
Mark or unmark the selected entry (Space). The selection stays put;
a run of entries is marked with visual mode (v).
ClearMarks
Unmark everything (Esc in Navigation Mode, :unmark).
PasteMarks(TransferKind)
Copy (pp) or move (pm) every marked entry into cwd.
EnterVisual
Enter visual mode (v), anchoring a range at the selection.
CommitVisual(Option<Box<Action>>)
Add the visual range to the marks and return to Navigation Mode, then
apply the follow-up action if there is one — so h/l in visual mode
mark the range and navigate in one key.
Set state.pending_nav_key to begin a multi-key Navigation Mode
sequence (y for clipboard, d for delete). The following key
resolves the sequence in keymap::navigation.
RunExternal
Run an external process using the terminal suspend/resume sequence.
Produced by apply for file-open and !<shell command> actions;
handled by the event loop in main.rs which calls
shell_exec::run_external and forces a full redraw on return.
Fields
pause: ShellPauseWhether to hold the screen after the command finishes so its output
can be read. Resolved from [general] shell_pause for ! and
:git, and always shell_exec::ShellPause::Never for the editor
and OS-handler opens, which draw their own screens.
Quit
Quit the application normally (writes --cwd-file in Phase 6).
Cancel
Cancel the application without writing --cwd-file.
Mapped to Ctrl-C. The shell wrapper does nothing and the parent
shell stays in its original directory.
OpenWithOs
Open the selected entry with the OS default handler.
On macOS uses open, on Linux xdg-open, on Windows explorer.
Bound to o in Navigation Mode.
NewTab
Open a new tab rooted at the current working directory.
CloseTab
Close the currently active tab. No-op if only one tab is open.
SwitchTabNext
Switch focus to the next tab, wrapping from the last to the first.
SwitchTabPrev
Switch focus to the previous tab, wrapping from the first to the last.
Trait Implementations§
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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