Skip to content

Commit

Permalink
Use distinct carets for line number hovers (zed-industries#22836)
Browse files Browse the repository at this point in the history
Release Notes:

- N/A
  • Loading branch information
SomeoneToIgnore authored Jan 8, 2025
1 parent a9d2628 commit 6f2b882
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/editor/src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3958,7 +3958,13 @@ impl EditorElement {
let Some(()) = line.paint(hitbox.origin, line_height, cx).log_err() else {
continue;
};
cx.set_cursor_style(CursorStyle::PointingHand, hitbox);
// 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);
}
}
}

Expand Down

0 comments on commit 6f2b882

Please sign in to comment.