From 269df10a16b3d9a95d97be6103141e3b70d75172 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 28 Feb 2023 20:27:34 -0800 Subject: [PATCH] Fix off by one error in click ranges --- crates/editor/src/element.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index a44cb78197..239be52461 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -221,7 +221,8 @@ impl EditorElement { position_to_display_point(e.position, text_bounds, &position_map); if let Some(point) = point { for (range, callback) in click_ranges.iter() { - if range.contains(&point) { + // Range -> RangeInclusive + if range.contains(&point) || range.end == point { callback(&e, range, &position_map.snapshot, cx) } }