Skip to content

Commit

Permalink
adding line cancel (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinmuthukumar authored Feb 2, 2024
1 parent 7edb60d commit f5a2947
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/shrs_line/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,18 @@ impl Line {
Event::Paste(p) => {
ctx.cb.insert(Location::Cursor(), p.as_str())?;
},
Event::Key(KeyEvent {
code: KeyCode::Char('c'),
modifiers: KeyModifiers::CONTROL,
..
}) => {
ctx.cb.clear();
self.buffer_history.clear();
ctx.lines = String::new();
self.painter.newline()?;

return Ok(true);
},

Event::Key(KeyEvent {
code: KeyCode::Enter,
Expand Down

0 comments on commit f5a2947

Please sign in to comment.