Merge pull request #1388 from zed-industries/mouse-region-refactor

Mouse Region Refactor
This commit is contained in:
Keith Simmons 2022-07-19 16:50:12 -07:00 committed by GitHub
commit c2868a39e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 728 additions and 440 deletions

View file

@ -30,8 +30,8 @@ use gpui::{
impl_actions, impl_internal_actions,
platform::CursorStyle,
text_layout, AppContext, AsyncAppContext, ClipboardItem, Element, ElementBox, Entity,
ModelHandle, MutableAppContext, RenderContext, Subscription, Task, View, ViewContext,
ViewHandle, WeakViewHandle,
ModelHandle, MouseButton, MutableAppContext, RenderContext, Subscription, Task, View,
ViewContext, ViewHandle, WeakViewHandle,
};
use highlight_matching_bracket::refresh_matching_bracket_highlights;
use hover_popover::{hide_hover, HoverState};
@ -707,7 +707,7 @@ impl CompletionsMenu {
},
)
.with_cursor_style(CursorStyle::PointingHand)
.on_mouse_down(move |_, cx| {
.on_mouse_down(MouseButton::Left, move |_, cx| {
cx.dispatch_action(ConfirmCompletion {
item_ix: Some(item_ix),
});
@ -840,7 +840,7 @@ impl CodeActionsMenu {
.boxed()
})
.with_cursor_style(CursorStyle::PointingHand)
.on_mouse_down(move |_, cx| {
.on_mouse_down(MouseButton::Left, move |_, cx| {
cx.dispatch_action(ConfirmCodeAction {
item_ix: Some(item_ix),
});
@ -2674,7 +2674,7 @@ impl Editor {
})
.with_cursor_style(CursorStyle::PointingHand)
.with_padding(Padding::uniform(3.))
.on_mouse_down(|_, cx| {
.on_mouse_down(MouseButton::Left, |_, cx| {
cx.dispatch_action(ToggleCodeActions {
deployed_from_indicator: true,
});