Skip to content

Commit

Permalink
Make r<tab> and f<tab> work (#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 Nov 19, 2022
1 parent 7e99087 commit 0e23e4f
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 0e23e4f

Please sign in to comment.