commands: Handle t<ENTER>
as till newline
This commit is contained in:
parent
a8a5bcd13d
commit
0c2b99327a
1 changed files with 26 additions and 20 deletions
|
@ -348,11 +348,18 @@ where
|
|||
|
||||
// need to wait for next key
|
||||
cx.on_next_key(move |cx, event| {
|
||||
if let KeyEvent {
|
||||
let ch = match event {
|
||||
KeyEvent {
|
||||
code: KeyCode::Enter,
|
||||
..
|
||||
} => '\n',
|
||||
KeyEvent {
|
||||
code: KeyCode::Char(ch),
|
||||
..
|
||||
} = event
|
||||
{
|
||||
} => ch,
|
||||
_ => return,
|
||||
};
|
||||
|
||||
let (view, doc) = cx.current();
|
||||
let text = doc.text().slice(..);
|
||||
|
||||
|
@ -369,7 +376,6 @@ where
|
|||
});
|
||||
|
||||
doc.set_selection(view.id, selection);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue