Skip to main content

PartialChordPending

Struct PartialChordPending 

Source
pub struct PartialChordPending {
    pub chords: Vec<KeyChord>,
    pub binding_mode: BindingMode,
    pub active_modes: Vec<ModeId>,
    pub pane_width: u16,
}
Expand description

Published on every keystroke whose outcome changes the pending-chord state: a prefix was entered, extended, resolved, or aborted. chords is empty when nothing is pending, which is the dismissal signal subscribers key off.

§The payload rides on the event

It would be smaller to publish a bare “something changed” ping and have subscribers read the published render state — and it would be wrong. Tick callbacks run before the publish in both actor arms, so a subscriber reading published state would observe the PREVIOUS keystroke’s prefix and arm one keystroke late. Carrying the payload makes that class of bug unrepresentable.

§pane_width

Carried so the grid can be laid out in lattice-keymap (the width is known at build time), which keeps the popup’s content ordinary buffer text: everything-is-a-buffer holds, no new render model crosses into either renderer, and the column algorithm is unit-testable with no renderer at all. The cost is that a resize while a popup is up leaves a stale grid, so subscribers dismiss on resize.

Fields§

§chords: Vec<KeyChord>

The chords pressed so far. Empty = nothing pending.

§binding_mode: BindingMode

The binding mode the next keystroke will resolve in.

§active_modes: Vec<ModeId>

The active buffer’s keymap-gated modes, in the order lookup_with_context wants them (active major first, then minors in activation order).

§pane_width: u16

Text width of the pane the chord is pending in.

Trait Implementations§

Source§

impl Clone for PartialChordPending

Source§

fn clone(&self) -> PartialChordPending

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 PartialChordPending

Source§

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

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

impl Eq for PartialChordPending

Source§

impl Event for PartialChordPending

Source§

fn event_type_id(&self) -> EventTypeId

The type-id under which this event is registered. Implementors typically delegate to a static to avoid re-allocating the metadata on every call. The macro register_event! generates this for you.
Source§

impl PartialEq for PartialChordPending

Source§

fn eq(&self, other: &PartialChordPending) -> 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 PartialChordPending

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
§

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

§

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.

§

impl<T> Instrument for T

§

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

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

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

impl<T> WithSubscriber for T

§

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
§

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

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