fixes
This commit is contained in:
@@ -65,6 +65,9 @@ pub enum Command {
|
||||
MoveToStart,
|
||||
MoveToEnd,
|
||||
|
||||
// Vim mode
|
||||
EnterInsertMode,
|
||||
|
||||
// Profile
|
||||
OpenProfile,
|
||||
}
|
||||
@@ -100,6 +103,13 @@ impl KeyBinding {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_alt(key: KeyCode) -> Self {
|
||||
Self {
|
||||
key,
|
||||
modifiers: KeyModifiers::ALT,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn matches(&self, event: &KeyEvent) -> bool {
|
||||
self.key == event.code && self.modifiers == event.modifiers
|
||||
}
|
||||
@@ -234,9 +244,7 @@ impl Keybindings {
|
||||
bindings.insert(Command::Cancel, vec![
|
||||
KeyBinding::new(KeyCode::Esc),
|
||||
]);
|
||||
bindings.insert(Command::NewLine, vec![
|
||||
KeyBinding::with_shift(KeyCode::Enter),
|
||||
]);
|
||||
bindings.insert(Command::NewLine, vec![]);
|
||||
bindings.insert(Command::DeleteChar, vec![
|
||||
KeyBinding::new(KeyCode::Backspace),
|
||||
]);
|
||||
@@ -253,6 +261,12 @@ impl Keybindings {
|
||||
KeyBinding::with_ctrl(KeyCode::Char('e')),
|
||||
]);
|
||||
|
||||
// Vim mode
|
||||
bindings.insert(Command::EnterInsertMode, vec![
|
||||
KeyBinding::new(KeyCode::Char('i')),
|
||||
KeyBinding::new(KeyCode::Char('ш')), // RU
|
||||
]);
|
||||
|
||||
// Profile
|
||||
bindings.insert(Command::OpenProfile, vec![
|
||||
KeyBinding::with_ctrl(KeyCode::Char('u')), // Ctrl+U instead of Ctrl+I
|
||||
|
||||
Reference in New Issue
Block a user