diff --git a/src/edit_mode/vi/mod.rs b/src/edit_mode/vi/mod.rs index 7c7601d1..dc3fcb0a 100644 --- a/src/edit_mode/vi/mod.rs +++ b/src/edit_mode/vi/mod.rs @@ -251,6 +251,32 @@ mod test { assert_eq!(result, ReedlineEvent::CtrlD); } + #[test] + fn keybinding_with_super_modifier_test() { + let mut keybindings = default_vi_normal_keybindings(); + keybindings.add_binding( + KeyModifiers::SUPER, + KeyCode::Char('$'), + ReedlineEvent::CtrlD, + ); + + let mut vi = Vi { + insert_keybindings: default_vi_insert_keybindings(), + normal_keybindings: keybindings, + mode: ViMode::Normal, + ..Default::default() + }; + + let esc = ReedlineRawEvent::convert_from(Event::Key(KeyEvent::new( + KeyCode::Char('$'), + KeyModifiers::SUPER, + ))) + .unwrap(); + let result = vi.parse_event(esc); + + assert_eq!(result, ReedlineEvent::CtrlD); + } + #[test] fn non_register_modifier_test() { let keybindings = default_vi_normal_keybindings();