diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2024-12-29 00:47:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-29 00:47:47 +0300 |
commit | 7bd3b8991ce290e981d39d608a91bdc174b26f5d (patch) | |
tree | 57b5d4ce1231eb2cbcaf1865a91c6284a94dce90 /alacritty/src/input | |
parent | 62d5b134b3c32b6b691bb6aa6304e3d5d5c28c6d (diff) | |
download | r-alacritty-7bd3b8991ce290e981d39d608a91bdc174b26f5d.tar.gz r-alacritty-7bd3b8991ce290e981d39d608a91bdc174b26f5d.tar.bz2 r-alacritty-7bd3b8991ce290e981d39d608a91bdc174b26f5d.zip |
Don't switch semantic/line selection when control is pressed
Changing block selection to regular semantic one doesn't feel intuitive,
thus don't switch to it when user has control pressed.
Diffstat (limited to 'alacritty/src/input')
-rw-r--r-- | alacritty/src/input/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/alacritty/src/input/mod.rs b/alacritty/src/input/mod.rs index 1c9d6008..60a50529 100644 --- a/alacritty/src/input/mod.rs +++ b/alacritty/src/input/mod.rs @@ -637,6 +637,7 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> { /// Handle left click selection and vi mode cursor movement. fn on_left_click(&mut self, point: Point) { let side = self.ctx.mouse().cell_side; + let control = self.ctx.modifiers().state().control_key(); match self.ctx.mouse().click_state { ClickState::Click => { @@ -646,21 +647,21 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> { self.ctx.clear_selection(); // Start new empty selection. - if self.ctx.modifiers().state().control_key() { + if control { self.ctx.start_selection(SelectionType::Block, point, side); } else { self.ctx.start_selection(SelectionType::Simple, point, side); } }, - ClickState::DoubleClick => { + ClickState::DoubleClick if !control => { self.ctx.mouse_mut().block_hint_launcher = true; self.ctx.start_selection(SelectionType::Semantic, point, side); }, - ClickState::TripleClick => { + ClickState::TripleClick if !control => { self.ctx.mouse_mut().block_hint_launcher = true; self.ctx.start_selection(SelectionType::Lines, point, side); }, - ClickState::None => (), + _ => (), }; // Move vi mode cursor to mouse click position. |