Skip to content

Commit

Permalink
Make r<ENTER> work
Browse files Browse the repository at this point in the history
  • Loading branch information
vv9k authored and archseer committed Jun 8, 2021
1 parent 81e02e1 commit 4e3a343
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,19 @@ pub fn extend_first_nonwhitespace(cx: &mut Context) {
pub fn replace(cx: &mut Context) {
// need to wait for next key
cx.on_next_key(move |cx, event| {
if let KeyEvent {
code: KeyCode::Char(ch),
..
} = event
{
let ch = match event {
KeyEvent {
code: KeyCode::Char(ch),
..
} => Some(ch),
KeyEvent {
code: KeyCode::Enter,
..
} => Some('\n'),
_ => None,
};

if let Some(ch) = ch {
let (view, doc) = cx.current();

let transaction =
Expand Down

0 comments on commit 4e3a343

Please sign in to comment.