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: BindingModeThe 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: u16Text width of the pane the chord is pending in.
Trait Implementations§
Source§impl Clone for PartialChordPending
impl Clone for PartialChordPending
Source§fn clone(&self) -> PartialChordPending
fn clone(&self) -> PartialChordPending
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PartialChordPending
impl Debug for PartialChordPending
impl Eq for PartialChordPending
Source§impl Event for PartialChordPending
impl Event for PartialChordPending
Source§fn event_type_id(&self) -> EventTypeId
fn event_type_id(&self) -> EventTypeId
static to avoid
re-allocating the metadata on every call. The macro
register_event! generates this for you.Source§impl PartialEq for PartialChordPending
impl PartialEq for PartialChordPending
impl StructuralPartialEq for PartialChordPending
Auto Trait Implementations§
impl Freeze for PartialChordPending
impl RefUnwindSafe for PartialChordPending
impl Send for PartialChordPending
impl Sync for PartialChordPending
impl Unpin for PartialChordPending
impl UnsafeUnpin for PartialChordPending
impl UnwindSafe for PartialChordPending
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.