Skip to content

Commit 0e23e4f

Browse files
authored
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`).
1 parent 7e99087 commit 0e23e4f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

helix-term/src/commands.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)