command mode keybindings propery done
This commit is contained in:
@@ -300,4 +300,22 @@ impl Config {
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
pub fn is_command_execute(&self, key: KeyCode, modifiers: KeyModifiers) -> bool {
|
||||
if let Some(bindings) = self.keybindings.get("command_execute") {
|
||||
bindings.iter().any(|b| Self::matches_keybinding(b, key, modifiers))
|
||||
} else {
|
||||
// Fall back to Enter key if no command_execute is defined
|
||||
key == KeyCode::Enter && modifiers.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_command_backspace(&self, key: KeyCode, modifiers: KeyModifiers) -> bool {
|
||||
if let Some(bindings) = self.keybindings.get("command_backspace") {
|
||||
bindings.iter().any(|b| Self::matches_keybinding(b, key, modifiers))
|
||||
} else {
|
||||
// Fall back to Backspace key if no command_backspace is defined
|
||||
key == KeyCode::Backspace && modifiers.is_empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user