Skip to content

Commit

Permalink
Make r<tab> and f<tab> work (helix-editor#4817)
Browse files Browse the repository at this point in the history
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`).
  • Loading branch information
Ordoviz authored and Frederik Vestre committed Feb 6, 2023
1 parent 926bd06 commit 1f935ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
..
Expand Down Expand Up @@ -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,
};

Expand Down

0 comments on commit 1f935ac

Please sign in to comment.