mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 02:46:43 +00:00
Merge pull request #1545 from zed-industries/only-extend-selection-with-shift-without-other-modifiers
Only extend selection with shift without other modifiers
This commit is contained in:
commit
5019ae78c6
1 changed files with 16 additions and 14 deletions
|
@ -110,13 +110,17 @@ impl EditorElement {
|
||||||
self.update_view(cx, |view, cx| view.snapshot(cx))
|
self.update_view(cx, |view, cx| view.snapshot(cx))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
|
||||||
fn mouse_down(
|
fn mouse_down(
|
||||||
&self,
|
&self,
|
||||||
position: Vector2F,
|
MouseButtonEvent {
|
||||||
alt: bool,
|
position,
|
||||||
shift: bool,
|
ctrl,
|
||||||
mut click_count: usize,
|
alt,
|
||||||
|
shift,
|
||||||
|
cmd,
|
||||||
|
mut click_count,
|
||||||
|
..
|
||||||
|
}: MouseButtonEvent,
|
||||||
layout: &mut LayoutState,
|
layout: &mut LayoutState,
|
||||||
paint: &mut PaintState,
|
paint: &mut PaintState,
|
||||||
cx: &mut EventContext,
|
cx: &mut EventContext,
|
||||||
|
@ -135,7 +139,7 @@ impl EditorElement {
|
||||||
position,
|
position,
|
||||||
goal_column: target_position.column(),
|
goal_column: target_position.column(),
|
||||||
}));
|
}));
|
||||||
} else if shift {
|
} else if shift && !ctrl && !alt && !cmd {
|
||||||
cx.dispatch_action(Select(SelectPhase::Extend {
|
cx.dispatch_action(Select(SelectPhase::Extend {
|
||||||
position,
|
position,
|
||||||
click_count,
|
click_count,
|
||||||
|
@ -1576,14 +1580,12 @@ impl Element for EditorElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
&Event::MouseDown(MouseButtonEvent {
|
&Event::MouseDown(
|
||||||
button: MouseButton::Left,
|
event @ MouseButtonEvent {
|
||||||
position,
|
button: MouseButton::Left,
|
||||||
alt,
|
..
|
||||||
shift,
|
},
|
||||||
click_count,
|
) => self.mouse_down(event, layout, paint, cx),
|
||||||
..
|
|
||||||
}) => self.mouse_down(position, alt, shift, click_count, layout, paint, cx),
|
|
||||||
|
|
||||||
&Event::MouseDown(MouseButtonEvent {
|
&Event::MouseDown(MouseButtonEvent {
|
||||||
button: MouseButton::Right,
|
button: MouseButton::Right,
|
||||||
|
|
Loading…
Reference in a new issue