pub struct RootMenu {
pub source: &'static str,
pub chord: Option<&'static str>,
pub action: &'static str,
pub doc: &'static str,
}Expand description
dispatch_transient with the gates supplied rather than probed —
pure, and the form every guard over this menu uses.
MG.49: one root menu — reachable from the dispatch and from its
own chord.
Emacs binds these on magit-mode-map, the parent keymap every
magit-derived mode inherits, so z opens stash from the log buffer
and the diff buffer as much as from status. magit-core-mode is the
same shape here, which is why the chords live there rather than on
magit-status-mode.
Chords follow evil-collection-magit, the reference this crate
already uses for gr / O / x — so push is p, not magit’s P
(p is free in a read-only buffer; P is not, being paste).
Fields§
§source: &'static strRegistered TransientSourceRegistry name, and the string the
chord’s Effect::OpenTransient names.
chord: Option<&'static str>The chord magit-core-mode binds, or None when the key is a
live vim chord in a read-only buffer and the menu is reachable
only through the dispatch.
This is the constraint emacs does not have. Magit binds all
seventeen on magit-mode-map because emacs is not modal. Here a
minor-mode layer beats the builtin vim layer, so binding f
would take find-char away inside every magit buffer — and a
magit buffer is text you navigate. Vim’s grammar IS the public
command API (paramount goal #3), so it wins: only keys whose vim
meaning is an editing operator — inert where nothing is
editable — are free to take.
action: &'static strThe action the chord fires.
doc: &'static strKeymap documentation.
Auto Trait Implementations§
impl Freeze for RootMenu
impl RefUnwindSafe for RootMenu
impl Send for RootMenu
impl Sync for RootMenu
impl Unpin for RootMenu
impl UnsafeUnpin for RootMenu
impl UnwindSafe for RootMenu
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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