Skip to main content

MenuAction

Enum MenuAction 

Source
pub enum MenuAction {
Show 27 variants Accept, AcceptAndMenuComplete, AcceptAndInferNextHistory, Cancel, Up, Down, Left, Right, PageUp, PageDown, Beginning, End, BeginningOfLine, EndOfLine, Next, Prev, NextGroup, PrevGroup, ToggleInteractive, SearchForward, SearchBackward, Undo, Redisplay, Search, ClearSearch, Insert(char), Backspace,
}
Expand description

Key actions for menu completion (maps to zsh widget bindings)

These actions match zsh’s Src/Zle/complist.c behavior exactly:

  • Navigation (Up/Down/Left/Right) moves in the menu grid with wrapping
  • Accept exits the menu and inserts the selection
  • AcceptAndMenuComplete accepts current, then runs a NEW completion cycle
  • AcceptAndInferNextHistory same as above (both push state stack, call do_menucmp)
  • ReverseMenuComplete cycles to previous match via completion (not just prev item)
  • ToggleInteractive enters/exits MM_INTER mode for type-to-filter
  • SearchForward/Backward enters MM_FSEARCH/MM_BSEARCH incremental search

Variants§

§

Accept

Exit menu, accept current selection (accept-line)

§

AcceptAndMenuComplete

Accept current + trigger NEW completion on modified line (accept-and-menu-complete) This is NOT “advance to next item” - it runs a fresh completion cycle

§

AcceptAndInferNextHistory

Accept current + trigger NEW completion (accept-and-infer-next-history) Same behavior as AcceptAndMenuComplete in menuselect context

§

Cancel

Exit menu without accepting (send-break)

§

Up

Move up in menu grid, wrap to bottom+left at top (up-history)

§

Down

Move down in menu grid, wrap to top+right at bottom (down-history)

§

Left

Move left in menu grid, wrap to prev row at col 0 (vi-backward-char)

§

Right

Move right in menu grid, wrap to next row at end (vi-forward-char)

§

PageUp

Page up by screenful (vi-backward-word)

§

PageDown

Page down by screenful (vi-forward-word)

§

Beginning

Jump to first item (beginning-of-history)

§

End

Jump to last item (end-of-history)

§

BeginningOfLine

Jump to beginning of current row (vi-beginning-of-line)

§

EndOfLine

Jump to end of current row (vi-end-of-line)

§

Next

Cycle to next match via completion (menu-complete)

§

Prev

Cycle to previous match via completion with zmult=-1 (reverse-menu-complete) This calls do_menucmp(0) with negative multiplier

§

NextGroup

Jump to next group (vi-forward-blank-word)

§

PrevGroup

Jump to previous group (vi-backward-blank-word)

§

ToggleInteractive

Toggle interactive/filter mode MM_INTER (vi-insert)

§

SearchForward

Enter forward incremental search MM_FSEARCH (history-incremental-search-forward)

§

SearchBackward

Enter backward incremental search MM_BSEARCH (history-incremental-search-backward)

§

Undo

Undo last accept (pops from menu stack)

§

Redisplay

Force redisplay

§

Search

Generic search (alias for SearchForward)

§

ClearSearch

Clear current search string

§

Insert(char)

Insert character (in interactive/search mode)

§

Backspace

Delete last character (in interactive/search mode)

Trait Implementations§

Source§

impl Clone for MenuAction

Source§

fn clone(&self) -> MenuAction

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MenuAction

Source§

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

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

impl PartialEq for MenuAction

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for MenuAction

Source§

impl Eq for MenuAction

Source§

impl StructuralPartialEq for MenuAction

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

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