:disabled in the edit mode, cant type it tho, needs fix

This commit is contained in:
filipriec
2025-03-23 00:28:51 +01:00
parent 1a529a70bf
commit fef2f12c9a
2 changed files with 19 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
# config.toml # config.toml
[keybindings] [keybindings]
# [keybindings.global] enter_command_mode = [":", "ctrl+;"]
[keybindings.intro] [keybindings.intro]
next_option = ["j", "Right"] next_option = ["j", "Right"]
@@ -40,7 +40,6 @@ move_line_start = ["0"]
move_line_end = ["$"] move_line_end = ["$"]
move_first_line = ["gg"] move_first_line = ["gg"]
move_last_line = ["x"] move_last_line = ["x"]
enter_command_mode = [":", "ctrl+;"]
[keybindings.edit] [keybindings.edit]
exit_edit_mode = ["esc","ctrl+e"] exit_edit_mode = ["esc","ctrl+e"]

View File

@@ -81,6 +81,24 @@ impl EventHandler {
))); )));
} }
// Global command mode activation
let context_action = config.get_action_for_current_context(
self.is_edit_mode,
self.command_mode,
app_state.ui.show_intro,
app_state.ui.show_admin,
key_code,
modifiers
);
if let Some("enter_command_mode") = context_action {
if self.is_edit_mode { return Ok((false, String::new())); }
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( if let Some(action) = config.get_action_for_key_in_mode(
&config.keybindings.common, &config.keybindings.common,
key_code, key_code,