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:
parent
7e99087fa3
commit
0e23e4f882
@ -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,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user