trying to make the intro and admin with general keybindings

This commit is contained in:
filipriec
2025-03-23 19:17:42 +01:00
parent 87b07db26a
commit fbcea1b270
3 changed files with 29 additions and 7 deletions

View File

@@ -112,6 +112,15 @@ impl EventHandler {
_ => {}
}
}
if let Some("enter_command_mode") = config.get_action_for_key_in_mode(
&config.keybindings.global,
key_code,
modifiers
) {
self.command_mode = true;
return Ok((false, String::new()));
}
// If no general action matched, return to stay in general mode
return Ok((false, String::new()));
@@ -175,11 +184,14 @@ impl EventHandler {
modifiers
);
// Block command mode entry from edit mode
if let Some("enter_command_mode") = context_action {
self.command_mode = true;
self.command_input.clear();
self.command_message.clear();
return Ok((false, String::new()));
if !self.is_edit_mode {
self.command_mode = true;
self.command_input.clear();
self.command_message.clear();
return Ok((false, String::new()));
}
}
if let Some(action) = config.get_action_for_key_in_mode(