From 4932e61fc65caccf4c04f838944d6a73220b3823 Mon Sep 17 00:00:00 2001 From: Lennard Hofmann Date: Sat, 19 Nov 2022 13:14:34 +0100 Subject: [PATCH] Make `r` and `f` work Previously, commands such as `r` (replace with tab) or `t` (select till tab) had no effect. This is because `KeyCode::Tab` needs special treatment (like `KeyCode::Enter`). --- helix-term/src/commands.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c74dfb39cefc..1427c658f797 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1134,6 +1134,10 @@ where doc!(cx.editor).line_ending.as_str().chars().next().unwrap() } + KeyEvent { + code: KeyCode::Tab, .. + } => '\t', + KeyEvent { code: KeyCode::Char(ch), .. @@ -1280,6 +1284,9 @@ fn replace(cx: &mut Context) { code: KeyCode::Enter, .. } => Some(doc.line_ending.as_str()), + KeyEvent { + code: KeyCode::Tab, .. + } => Some("\t"), _ => None, };