Skip to main content

preemption

Function preemption 

Source
pub fn preemption(mode: Mode, key: &Key) -> Option<Preemption>
Expand description

Does dispatch answer (mode, key) before the binding table is consulted?

The single statement of the rule. Keymap::dispatch reads it to answer keys; anything auditing whether a DECLARATION could ever fire reads it to say so. Before it existed the rule lived in three inline if mode == blocks inside dispatch, visible to nothing else, so a binding for a bare printable character in Insert mode parsed, applied, reported as applied — and was dead on arrival with nowhere to learn that from.

Total over the preempting cases; everything else falls through to None, which is the safe direction (a key wrongly called reachable shows up as a binding that does not work, a key wrongly called dead hides a working one).