Skip to main content

register_foundation_modes

Function register_foundation_modes 

Source
pub fn register_foundation_modes(registry: &mut ModeRegistry)
Expand description

Register every foundation mode against registry. Called from the App’s mode-registry boot path before any buffer is created.

Not idempotent: each mode is registered with .expect(..), so a second call on the same registry panics on the first RegistrationError::Duplicate. The App calls it exactly once.

§Examples

use lattice_mode::{register_foundation_modes, ModeRegistry, TextMode};

let mut registry = ModeRegistry::new();
register_foundation_modes(&mut registry);
assert!(registry.is_registered(TextMode::mode_id()));
assert!(registry.is_registered(lattice_mode::EmacsKeysMode::mode_id()));