Fix off by one error in click ranges

This commit is contained in:
Mikayla Maki 2023-02-28 20:27:34 -08:00
parent 8358efbd6c
commit 269df10a16

View File

@ -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)
}
}