Skip to content

Commit

Permalink
fix: treat CTRL + J as Enter
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Sep 24, 2024
1 parent 660a507 commit 8548d1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/edit_mode/emacs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ impl EditMode for Emacs {
Event::Key(KeyEvent {
code, modifiers, ..
}) => match (modifiers, code) {
(KeyModifiers::CONTROL, KeyCode::Char('j')) => ReedlineEvent::Enter,
(modifier, KeyCode::Char(c)) => {
// Note. The modifier can also be a combination of modifiers, for
// example:
Expand Down
4 changes: 4 additions & 0 deletions src/edit_mode/vi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ impl EditMode for Vi {
self.mode = ViMode::Visual;
ReedlineEvent::Multiple(vec![ReedlineEvent::Esc, ReedlineEvent::Repaint])
}
(_, KeyModifiers::CONTROL, KeyCode::Char('j')) => {
self.mode = ViMode::Insert;
ReedlineEvent::Enter
}
(ViMode::Normal | ViMode::Visual, modifier, KeyCode::Char(c)) => {
let c = c.to_ascii_lowercase();

Expand Down

0 comments on commit 8548d1a

Please sign in to comment.