From 0e23e4f882ec840bed0e2c1ef3723deb7a258801 Mon Sep 17 00:00:00 2001 From: Lennard Hofmann Date: Sat, 19 Nov 2022 18:08:03 +0100 Subject: Make `r` and `f` work (#4817) 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(+) (limited to 'helix-term/src') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index b00e02b9..1b0c557e 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1131,6 +1131,10 @@ where doc!(cx.editor).line_ending.as_str().chars().next().unwrap() } + KeyEvent { + code: KeyCode::Tab, .. + } => '\t', + KeyEvent { code: KeyCode::Char(ch), .. @@ -1277,6 +1281,9 @@ fn replace(cx: &mut Context) { code: KeyCode::Enter, .. } => Some(doc.line_ending.as_str()), + KeyEvent { + code: KeyCode::Tab, .. + } => Some("\t"), _ => None, }; -- cgit v1.2.3-70-g09d2