on master help sign in
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`).

commit0e23e4f882ec840bed0e2c1ef3723deb7a258801 authorLennard Hofmann <lennard.hofmann@web.de> dateSat 19 Nov 2022, 18:08 (4 years ago) parent7e99087
1 file changed+7
helix-term/src/commands.rs+7
helix-term/src/commands.rs+7
@@ -1131,6 +1131,10 @@ where
11311131 doc!(cx.editor).line_ending.as_str().chars().next().unwrap()
11321132 }
11331133
1134+ KeyEvent {
1135+ code: KeyCode::Tab, ..
1136+ } => '\t',
1137+
11341138 KeyEvent {
11351139 code: KeyCode::Char(ch),
11361140 ..
@@ -1277,6 +1281,9 @@ fn replace(cx: &mut Context) {
12771281 code: KeyCode::Enter,
12781282 ..
12791283 } => Some(doc.line_ending.as_str()),
1284+ KeyEvent {
1285+ code: KeyCode::Tab, ..
1286+ } => Some("\t"),
12801287 _ => None,
12811288 };
12821289