changeset 3803:1a0455108f25

Make `r<tab>` and `f<tab>` work (#4817) Previously, commands such as `r<tab>` (replace with tab) or `t<tab>` (select till tab) had no effect. This is because `KeyCode::Tab` needs special treatment (like `KeyCode::Enter`).
author Lennard Hofmann <lennard.hofmann@web.de>
date Sat, 19 Nov 2022 18:08:03 +0100
parents 773c3caa8725
children 6b0ee10e5b24
files helix-term/src/commands.rs
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/helix-term/src/commands.rs	Sat Nov 19 15:41:55 2022 +0900
+++ b/helix-term/src/commands.rs	Sat Nov 19 18:08:03 2022 +0100
@@ -1132,6 +1132,10 @@
             }
 
             KeyEvent {
+                code: KeyCode::Tab, ..
+            } => '\t',
+
+            KeyEvent {
                 code: KeyCode::Char(ch),
                 ..
             } => ch,
@@ -1277,6 +1281,9 @@
                 code: KeyCode::Enter,
                 ..
             } => Some(doc.line_ending.as_str()),
+            KeyEvent {
+                code: KeyCode::Tab, ..
+            } => Some("\t"),
             _ => None,
         };