Merge branch 'main' into cursors

This commit is contained in:
Conrad Irwin
2024-01-18 14:03:27 -07:00
199 changed files with 3365 additions and 1735 deletions
+6 -5
View File
@@ -459,6 +459,7 @@ impl EditorElement {
event: &MouseUpEvent,
position_map: &PositionMap,
text_bounds: Bounds<Pixels>,
interactive_bounds: &InteractiveBounds,
stacking_order: &StackingOrder,
cx: &mut ViewContext<Editor>,
) {
@@ -469,7 +470,8 @@ impl EditorElement {
editor.select(SelectPhase::End, cx);
}
if !pending_nonempty_selections
if interactive_bounds.visibly_contains(&event.position, cx)
&& !pending_nonempty_selections
&& event.modifiers.command
&& text_bounds.contains(&event.position)
&& cx.was_top_layer(&event.position, stacking_order)
@@ -2590,15 +2592,14 @@ impl EditorElement {
let interactive_bounds = interactive_bounds.clone();
move |event: &MouseUpEvent, phase, cx| {
if phase == DispatchPhase::Bubble
&& interactive_bounds.visibly_contains(&event.position, cx)
{
if phase == DispatchPhase::Bubble {
editor.update(cx, |editor, cx| {
Self::mouse_up(
editor,
event,
&position_map,
text_bounds,
&interactive_bounds,
&stacking_order,
cx,
)
@@ -2647,7 +2648,7 @@ impl EditorElement {
}
#[derive(Debug)]
pub struct LineWithInvisibles {
pub(crate) struct LineWithInvisibles {
pub line: ShapedLine,
invisibles: Vec<Invisible>,
}