Skip to content

agent_panel: Fix mention pasting crash (#58375) (cherry-pick to preview)#58414

Merged
zed-zippy[bot] merged 1 commit into
v1.5.xfrom
cherry-pick-v1.5.x-7a8f1390
Jun 3, 2026
Merged

agent_panel: Fix mention pasting crash (#58375) (cherry-pick to preview)#58414
zed-zippy[bot] merged 1 commit into
v1.5.xfrom
cherry-pick-v1.5.x-7a8f1390

Conversation

@zed-zippy

@zed-zippy zed-zippy Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of #58375 to preview


This crash occurred because metion crease were using raw text ranges
that were precomputed before calling editor.edit(), and didn't take into
account that editor normalizes text inserted

The fix is normalizing the text first, then using the normalize text
range for the crease

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX
    checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fix a crash that could occur when adding a crease to the agent panel

This crash occurred because metion crease were using raw text ranges
that were precomputed before calling editor.edit(), and didn't take into
account that editor normalizes text inserted

The fix is normalizing the text first, then using the normalize text
range for the crease

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:

- Fix a crash that could occur when adding a crease to the agent panel
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 3, 2026
@zed-community-bot zed-community-bot Bot added the bot Pull requests authored by a bot label Jun 3, 2026
@zed-zippy zed-zippy Bot merged commit 95ee0e6 into v1.5.x Jun 3, 2026
41 checks passed
@zed-zippy zed-zippy Bot deleted the cherry-pick-v1.5.x-7a8f1390 branch June 3, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant