Merge pull request #2229 from zed-industries/fix-click-range-bug

Fix off by one error in click ranges
This commit is contained in:
Mikayla Maki 2023-02-28 20:33:00 -08:00 committed by GitHub
commit 2e1adb0724
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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