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`).
This commit is contained in:
Lennard Hofmann 2022-11-19 18:08:03 +01:00 committed by GitHub
parent 7e99087fa3
commit 0e23e4f882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1131,6 +1131,10 @@ fn will_find_char<F>(cx: &mut Context, search_fn: F, inclusive: bool, extend: bo
doc!(cx.editor).line_ending.as_str().chars().next().unwrap()
}
KeyEvent {
code: KeyCode::Tab, ..
} => '\t',
KeyEvent {
code: KeyCode::Char(ch),
..
@ -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,
};