From f38ede8631b083c1c74d31b7658ad162d31c3972 Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Mon, 29 Aug 2022 00:48:49 +0000 Subject: Add bracketed paste (#3233) --- helix-view/src/input.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'helix-view/src') 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 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), } } } -- cgit v1.2.3-70-g09d2