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