Skip to main content

Action

Enum Action 

Source
pub enum Action {
Show 38 variants Quit, Cursor(Motion), Expand, Collapse, ToggleSubtree, CollapseAll, Mark, MarkAll, Commit, ToggleMap, CycleSort, ReverseSort, SortBy(Order), Select(NodeId), OpenRow(NodeId), MarkRow(NodeId), Price(NodeId), ScrollRows(Motion), OpenFilter, CyclePreset(Turn), CycleTiers, ToggleFiles, ToggleKind(Kind), Type(char), Erase, EraseAhead, Wipe, Caret(Motion), Submit, Help, Back, Dismiss, Highlight(Turn), Answer, Scroll(Motion), Listing(Motion), Spare, Ignore,
}
Expand description

What a keypress asked for.

Separated from carrying it out so the keymap can be asserted directly: “h collapses” is one assertion here rather than a terminal, a fixture tree and a rendered frame.

Variants§

§

Quit

q Ctrl-c — put the terminal back and go.

§

Cursor(Motion)

A motion key — move the cursor, which moves the viewport with it.

§

Expand

l Enter — open a row, or step into an open one.

§

Collapse

h — close a row, or step out of a closed one.

§

ToggleSubtree

* — open or close everything under the cursor at once.

§

CollapseAll

z — close every open row, back to the roots.

Not a toggle, where ToggleSubtree is: * is ambiguous on a partly-open subtree and this key is not, so it keeps the one meaning it has. An “open everything” companion is deliberately absent — one real home directory expands to 22,765 rows, and that is not a view anybody asked for.

§

Mark

space — mark the row’s whole subtree, or unmark it.

The key npkill uses for selecting a row, doing the thing npkill’s flat list cannot: a mark on a collapsed row covers everything beneath it.

§

MarkAll

a — mark everything, or clear the marks.

Ambiguous on a partial selection in a way space is not, and resolved toward clearing: a reader who has marked forty directories and presses an unfamiliar key can afford to lose the selection and cannot afford to gain thirty more.

§

Commit

x — remove what is marked. Asks first.

pua’s key for the one thing that writes, and the sentence in the help says that it asks: a reader scanning the page for a way to free space must not have to press it to find out whether it is armed. The key asks and never deletes; the only thing that commits is the dialog handing back what it was holding.

§

ToggleMap

m — show or hide the treemap pane.

A key rather than a flag, and the reason is the one every part of super::treemap turns on: an enhancement a reader cannot dismiss is not an enhancement. It is on the tree’s surface rather than among the globals because what it changes is how the tree pane is laid out.

§

CycleSort

s — the next sort key.

§

ReverseSort

S — the same key, upside down.

§

SortBy(Order)

1 2 3, or a click on a column heading — order a level by that key.

Reverses when it names the order already in force, and starts a new column the right way up: see super::state::View::sort_by.

§

Select(NodeId)

A click on a row’s name — put the cursor on that directory.

By NodeId and never by row index; see Spot::Row.

§

OpenRow(NodeId)

A click on a row’s — open that row, or close it.

The one thing and between them do, reached with one gesture and without the cursor having to be there first.

§

MarkRow(NodeId)

A click on a row’s [ ] — mark that row’s subtree, or unmark it.

space for a reader who is pointing. pristine draws a box on every row, and a box that cannot be pressed is a lie the screen tells about itself.

§

Price(NodeId)

A double click on a row — price everything under it that carries no price.

The expensive thing a reader wants on one specific subtree, which is what --breakdown-under is on the command line. A double click is the gesture for it because it is the one that says “this one, in particular”.

§

ScrollRows(Motion)

The wheel over the tree — move the viewport, taking the cursor with it.

Distinct from Cursor, which moves the cursor and lets the viewport follow: this is the other way round.

§

OpenFilter

/ — open the filter prompt.

§

CyclePreset(Turn)

f F — the next named view, or the one before.

A view is the two axes of super::lens together, and this key walks the presets over them. Deliberately not a key that changes the selection: what is marked is independent of what is visible, and the whole point of the pair is that a reader can narrow the screen without narrowing what they are about to delete.

§

CycleTiers

t — move the tier axis on its own: named, named + gitignored, gitignored.

The presets are shortcuts through four points; this and ToggleKind are what make every other point reachable. Without them “show me every cache a rule named” is a combination the model can hold and no reader can ask for, which is not what “stays expressible” can mean.

§

ToggleFiles

i — show or hide gitignored files, leaving both other axes exactly as they were.

Its own key rather than a value on the tier axis, for the reason super::lens::Lens::files gives: a preset moves one axis per step and all would have to move two to reach files. The request asked for exactly this — includable and excludable independently of ignored directories — so the key is the feature rather than a convenience over it.

§

ToggleKind(Kind)

u d b c n — turn one kind on or off, leaving the others and the tier axis exactly as they were.

One key per member rather than a cycle, because a set of five has thirty-two states and a cycle through thirty-two is a key nobody can aim.

§

Type(char)

A printable character, while the prompt has it.

Not in [KEYMAP], and it could not be: it stands for every character a terminal can report, which is not a list. It is also not a keybinding — typing v into a text field is content, not a command.

§

Erase

Backspace in the prompt.

§

EraseAhead

Delete in the prompt.

§

Wipe

Ctrl-u — throw the prompt’s line away.

§

Caret(Motion)

Home End in the prompt.

§

Submit

Enter in the prompt — apply the filter.

§

Help

? — show or hide the help.

§

Back

Esc — step back one rung, and never quit.

§

Dismiss

A click on what the footer is saying — take it away, and nothing else.

The rung Back takes first, reached on its own rather than through the ladder. That distinction is the whole reason this is not just Back: a press is resolved against the frame the reader aimed at and acted on at the release, so a report that goes in between would leave a Back to fall through onto the rung below — and the rung below is the reader’s filter. A dismissal with nothing to dismiss does nothing.

§

Highlight(Turn)

on a confirmation — move the highlight between the two answers.

Arrows and not Tab: a modal quietly redefining a key is worst in the one place a reader is being asked to be careful.

§

Answer

Enter on a confirmation — answer with whichever one is highlighted.

It does not say which answer: the dialog holds both, so this is only “the one I am looking at”. The highlight starts on cancel, so the key a reader presses to get rid of what is in front of them is the safe one.

§

Scroll(Motion)

inside the help overlay.

§

Listing(Motion)

on a confirmation — move down the batch it is listing.

Distinct from Scroll, which moves a document with no cursor in it: here the line under the cursor is a directory, and Spare acts on it.

§

Spare

space on a confirmation — take the highlighted directory out of the batch.

The tree’s own mark key, on the one screen where a reader can see everything they marked at once. It is what makes the listing an answer to a surprise rather than a notification of one.

§

Ignore

A key with no meaning here, or a resize. Any event redraws, so this is genuinely nothing — the resize included, which needs only the frame.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

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 Copy for Action

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: &Action) -> 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<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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.