INNER CODE UNIT · Rust

default

bgreenwell/doxx · src/keymap/mod.rs:53

    fn default() -> Self {
        Self::from_preset(KeymapPreset::Default)
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_default_keymap() {
        let km = Keymap::default();
        assert_eq!(km.get_action(&KeyBinding::char('q')), Some(Action::Quit));
        assert_eq!(
            km.get_action(&KeyBinding::char('s')),
            Some(Action::EnterSearch)
        );
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…