mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-24 21:59:04 +00:00
Fixes editor hit testing when the editor is clipped, most easily noticeable in a partially off-screen markdown block in the agent panel. `PositionMap::point_for_position` was indexing into `self.line_layouts` relative to the editor's scroll position (which in this example doesn't apply because these editors don't scroll), rather than relative to `self.visible_row_range.start`. This caused the reported column to not always be computed using the correct row, which especially impacted rows closer to the bottom of the editor. Notice how closer to the bottom, `point_for_position` reports the correct row, but reports the column as 0: https://github.com/user-attachments/assets/2a5b2c8b-2994-4983-a33b-ede209ba00e6 Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixes selection not always matching the mouse position in a markdown block in the agent panel |
||
|---|---|---|
| .. | ||
| benches | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||