Skip to main content

Action

Enum Action 

Source
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.

§

SetPendingNavKey(char)

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

§argv: Vec<String>

The argument vector: argv[0] is the program, argv[1..] are args.

§cwd: PathBuf

Working directory for the subprocess. Typically state.cwd.

§pause: ShellPause

Whether 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.

§label: Option<String>

The command as typed, !cargo test or :git status, for the result block and the status bar. None for the editor and OS-handler opens, which report only when they fail.

§

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§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Action

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Action

Source§

impl PartialEq for Action

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Action

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

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

fn in_current_span(self) -> Instrumented<Self> ⓘ

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more