aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorCharlie Groves2022-08-29 00:48:49 +0000
committerGitHub2022-08-29 00:48:49 +0000
commitf38ede8631b083c1c74d31b7658ad162d31c3972 (patch)
tree58e93b5bf7a330b9d60a2c1c5a52d67fcd32971f /helix-view
parent51b62230da81913564692482d8f365e27d6f6cec (diff)
Add bracketed paste (#3233)
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/input.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-view/src/input.rs b/helix-view/src/input.rs
index 3b03087d..9fa679df 100644
--- a/helix-view/src/input.rs
+++ b/helix-view/src/input.rs
@@ -6,12 +6,13 @@ use std::fmt;
pub use crate::keyboard::{KeyCode, KeyModifiers};
-#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
+#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Hash)]
pub enum Event {
FocusGained,
FocusLost,
Key(KeyEvent),
Mouse(MouseEvent),
+ Paste(String),
Resize(u16, u16),
}
@@ -276,9 +277,7 @@ impl From<crossterm::event::Event> for Event {
crossterm::event::Event::Resize(w, h) => Self::Resize(w, h),
crossterm::event::Event::FocusGained => Self::FocusGained,
crossterm::event::Event::FocusLost => Self::FocusLost,
- crossterm::event::Event::Paste(_) => {
- unreachable!("crossterm shouldn't emit Paste events without them being enabled")
- }
+ crossterm::event::Event::Paste(s) => Self::Paste(s),
}
}
}