Use distinct carets for line number hovers (#22836)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-01-09 01:51:07 +02:00 committed by GitHub
parent a9d2628c05
commit 6f2b88239b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3958,9 +3958,15 @@ impl EditorElement {
let Some(()) = line.paint(hitbox.origin, line_height, cx).log_err() else { let Some(()) = line.paint(hitbox.origin, line_height, cx).log_err() else {
continue; continue;
}; };
// In singleton buffers, we select corresponding lines on the line number click, so use | -like cursor.
// In multi buffers, we open file at the line number clicked, so use a pointing hand cursor.
if is_singleton {
cx.set_cursor_style(CursorStyle::IBeam, hitbox);
} else {
cx.set_cursor_style(CursorStyle::PointingHand, hitbox); cx.set_cursor_style(CursorStyle::PointingHand, hitbox);
} }
} }
}
fn paint_diff_hunks(layout: &mut EditorLayout, cx: &mut WindowContext) { fn paint_diff_hunks(layout: &mut EditorLayout, cx: &mut WindowContext) {
if layout.display_hunks.is_empty() { if layout.display_hunks.is_empty() {