Skip to content

editor: Show format selections for cursor ranges - #56571

Merged
ChristopherBiscardi merged 2 commits into
zed-industries:mainfrom
terror:format-selections
Jun 9, 2026
Merged

editor: Show format selections for cursor ranges#56571
ChristopherBiscardi merged 2 commits into
zed-industries:mainfrom
terror:format-selections

Conversation

@terror

@terror terror commented May 12, 2026

Copy link
Copy Markdown
Contributor

Resolves #56556

This diff fixes format selections being unavailable when the selection is a cursor range. The action was gated on having at least one non-empty selection, which hid it even when the active formatter supported range formatting.

With this change, cursor ranges are included when checking whether the selected buffers support range formatting. This restores the cursor-based Format Selections behavior while preserving the existing formatter-capability gate, so the action still stays hidden for formatters that cannot format ranges.

Screen.Recording.2026-05-12.at.2.57.44.PM.mov

Release Notes:

  • Fixed format selections not being available for cursor ranges when the active formatter supports range formatting.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 12, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:editor Feedback for code editing, formatting, editor iterations, etc label May 12, 2026
@daniel-thompson

Copy link
Copy Markdown

That was very quick!

Probably not neeed given the screen recording is very clear but I did also run a local build (with my normal keymaps and other config reinstated) and can confirm that, with this change, everything works as I am used to from 0.233.10.

@terror terror changed the title Show format selections for cursor ranges editor: Show format selections for cursor ranges May 23, 2026

@daniel-thompson daniel-thompson left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Very targeted, "obviously correct" and with a test case.

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

And thank you @daniel-thompson for the community review. That kind of review is a valuable contribution too.

@ChristopherBiscardi
ChristopherBiscardi added this pull request to the merge queue Jun 9, 2026
Merged via the queue into zed-industries:main with commit 05eea8a Jun 9, 2026
32 checks passed
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
Resolves zed-industries#56556  

This diff fixes format selections being unavailable when the selection
is a cursor range. The action was gated on having at least one non-empty
selection, which hid it even when the active formatter supported range
formatting.

With this change, cursor ranges are included when checking whether the
selected buffers support range formatting. This restores the
cursor-based `Format Selections` behavior while preserving the existing
formatter-capability gate, so the action still stays hidden for
formatters that cannot format ranges.


https://github.com/user-attachments/assets/fc2ab2b7-1af3-4849-841a-b57a685d748f

Release Notes:
- Fixed format selections not being available for cursor ranges when the
active formatter supports range formatting.

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Resolves zed-industries#56556  

This diff fixes format selections being unavailable when the selection
is a cursor range. The action was gated on having at least one non-empty
selection, which hid it even when the active formatter supported range
formatting.

With this change, cursor ranges are included when checking whether the
selected buffers support range formatting. This restores the
cursor-based `Format Selections` behavior while preserving the existing
formatter-capability gate, so the action still stays hidden for
formatters that cannot format ranges.


https://github.com/user-attachments/assets/fc2ab2b7-1af3-4849-841a-b57a685d748f

Release Notes:
- Fixed format selections not being available for cursor ranges when the
active formatter supports range formatting.

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editor Feedback for code editing, formatting, editor iterations, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

editor: format selections no longer working (since Zed 1.0.0)

3 participants