Make r<ENTER>
work
This commit is contained in:
parent
81e02e1ba4
commit
4e3a343602
1 changed files with 13 additions and 5 deletions
|
@ -461,11 +461,19 @@ pub fn extend_first_nonwhitespace(cx: &mut Context) {
|
|||
pub fn replace(cx: &mut Context) {
|
||||
// need to wait for next key
|
||||
cx.on_next_key(move |cx, event| {
|
||||
if let KeyEvent {
|
||||
code: KeyCode::Char(ch),
|
||||
..
|
||||
} = event
|
||||
{
|
||||
let ch = match event {
|
||||
KeyEvent {
|
||||
code: KeyCode::Char(ch),
|
||||
..
|
||||
} => Some(ch),
|
||||
KeyEvent {
|
||||
code: KeyCode::Enter,
|
||||
..
|
||||
} => Some('\n'),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
if let Some(ch) = ch {
|
||||
let (view, doc) = cx.current();
|
||||
|
||||
let transaction =
|
||||
|
|
Loading…
Add table
Reference in a new issue