From 6f2b88239bc0a2c4742c357317205083b105d76c Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 9 Jan 2025 01:51:07 +0200 Subject: [PATCH] Use distinct carets for line number hovers (#22836) Release Notes: - N/A --- crates/editor/src/element.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 509ea6bf4facd..0fdc3fd732644 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -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); + } } }