Skip to content

Commit

Permalink
use insert/overwrite_chars
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Apr 14, 2024
1 parent f5156d9 commit 8f4b0f1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions promkit-async/examples/lazyutil/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ pub fn default(
fin_sender: &Sender<()>,
) -> anyhow::Result<()> {
match event {
WrappedEvent::KeyBuffer(chars) => {
for ch in chars {
match state.edit_mode {
text_editor::Mode::Insert => state.texteditor.insert(*ch),
text_editor::Mode::Overwrite => state.texteditor.overwrite(*ch),
}
}
}
WrappedEvent::KeyBuffer(chars) => match state.edit_mode {
text_editor::Mode::Insert => state.texteditor.insert_chars(&chars),
text_editor::Mode::Overwrite => state.texteditor.overwrite_chars(&chars),
},
WrappedEvent::Other(e) => match e {
Event::Key(KeyEvent {
code: KeyCode::Enter,
Expand Down

0 comments on commit 8f4b0f1

Please sign in to comment.