diff options
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r-- | helix-term/src/ui/editor.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 6b316374..401d284e 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1,6 +1,6 @@ use crate::{ commands, - compositor::{Component, Context, EventResult}, + compositor::{Component, Context, Event, EventResult}, job, key, keymap::{KeymapResult, Keymaps}, ui::{Completion, ProgressSpinners}, @@ -19,13 +19,12 @@ use helix_view::{ document::Mode, editor::{CompleteAction, CursorShapeConfig}, graphics::{Color, CursorKind, Modifier, Rect, Style}, - input::KeyEvent, + input::{KeyEvent, MouseButton, MouseEvent, MouseEventKind}, keyboard::{KeyCode, KeyModifiers}, Document, Editor, Theme, View, }; use std::borrow::Cow; -use crossterm::event::{Event, MouseButton, MouseEvent, MouseEventKind}; use tui::buffer::Buffer as Surface; use super::lsp::SignatureHelp; @@ -966,7 +965,7 @@ impl EditorView { if let Some((pos, view_id)) = pos_and_view(editor, row, column) { let doc = editor.document_mut(editor.tree.get(view_id).doc).unwrap(); - if modifiers == crossterm::event::KeyModifiers::ALT { + if modifiers == KeyModifiers::ALT { let selection = doc.selection(view_id).clone(); doc.set_selection(view_id, selection.push(Range::point(pos))); } else { @@ -1068,7 +1067,7 @@ impl EditorView { let line = coords.row + view.offset.row; if let Ok(pos) = doc.text().try_line_to_char(line) { doc.set_selection(view_id, Selection::point(pos)); - if modifiers == crossterm::event::KeyModifiers::ALT { + if modifiers == KeyModifiers::ALT { commands::MappableCommand::dap_edit_log.execute(cxt); } else { commands::MappableCommand::dap_edit_condition.execute(cxt); @@ -1087,7 +1086,7 @@ impl EditorView { return EventResult::Ignored(None); } - if modifiers == crossterm::event::KeyModifiers::ALT { + if modifiers == KeyModifiers::ALT { commands::MappableCommand::replace_selections_with_primary_clipboard .execute(cxt); @@ -1132,9 +1131,8 @@ impl Component for EditorView { // Handling it here but not re-rendering will cause flashing EventResult::Consumed(None) } - Event::Key(key) => { + Event::Key(mut key) => { cx.editor.reset_idle_timer(); - let mut key = KeyEvent::from(key); canonicalize_key(&mut key); // clear status |