Merge remote-tracking branch 'origin/main' into cache

# Conflicts:
#	crates/copilot/src/sign_in.rs
#	crates/gpui/src/window.rs
#	crates/workspace/src/pane_group.rs
This commit is contained in:
Antonio Scandurra 2024-01-10 22:57:47 +01:00
commit 1c260e6dfd
216 changed files with 4218 additions and 2389 deletions

View file

@ -424,7 +424,6 @@ impl TerminalElement {
let line_height = font_pixels * line_height.to_pixels(rem_size);
let font_id = cx.text_system().resolve_font(&text_style.font());
// todo!(do we need to keep this unwrap?)
let cell_width = text_system
.advance(font_id, font_pixels, 'm')
.unwrap()
@ -451,6 +450,18 @@ impl TerminalElement {
}
});
let interactive_text_bounds = InteractiveBounds {
bounds,
stacking_order: cx.stacking_order().clone(),
};
if interactive_text_bounds.visibly_contains(&cx.mouse_position(), cx) {
if self.can_navigate_to_selected_word && last_hovered_word.is_some() {
cx.set_cursor_style(gpui::CursorStyle::PointingHand)
} else {
cx.set_cursor_style(gpui::CursorStyle::IBeam)
}
}
let hyperlink_tooltip = last_hovered_word.clone().map(|hovered_word| {
div()
.size_full()
@ -512,7 +523,6 @@ impl TerminalElement {
underline: Default::default(),
}],
)
//todo!(do we need to keep this unwrap?)
.unwrap()
};
@ -652,21 +662,6 @@ impl TerminalElement {
},
),
);
self.interactivity.on_click({
let terminal = terminal.clone();
move |e, cx| {
if e.down.button == MouseButton::Right {
let mouse_mode = terminal.update(cx, |terminal, _cx| {
terminal.mouse_mode(e.down.modifiers.shift)
});
if !mouse_mode {
//todo!(context menu)
// view.deploy_context_menu(e.position, cx);
}
}
}
});
self.interactivity.on_scroll_wheel({
let terminal = terminal.clone();
move |e, cx| {