Skip to content

workspace: Add command to reset pane sizes - #59046

Merged
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
42piratas:reset-pane-sizes
Jun 11, 2026
Merged

workspace: Add command to reset pane sizes#59046
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
42piratas:reset-pane-sizes

Conversation

@42piratas

Copy link
Copy Markdown
Contributor

Summary

Exposes the existing recursive pane-size reset as a command-palette action, so it can be invoked outside of vim mode.

The center pane grid's sizes can already be evened out by double-clicking a divider, or via vim::ResetPaneSizes (ctrl-w =) when vim mode is on, but there is no general action for it — so users not in vim mode have no discoverable way to undo a drifted split layout in one step.

How it works

workspace::ResetPaneSizes (palette: "workspace: reset pane sizes") calls the existing Workspace::reset_pane_sizes, which resets every PaneAxis in the center pane group to equal flexes, recursing into nested splits. The split structure is preserved — no panes are added, removed, or rearranged, only their sizes are equalized. This is the same path the vim ctrl-w = binding and the divider double-click already use.

Out of scope

  • Docks (left/right/bottom panels) — they keep their existing Reset Active Dock Size / Reset Open Docks Size actions.
  • The terminal panel's internal splits — it is a separate panel, not part of the center pane group.
  • No default keybinding (palette-only); vim users keep ctrl-w =.

Testing

Added test_reset_pane_sizes: builds a nested split (a horizontal axis of three panes whose last child is a vertical split), skews every axis's flexes, dispatches the action, and asserts every axis returns to uniform sizes.

Release Notes:

  • Added a workspace: reset pane sizes command that equalizes the sizes of all panes in the center group

Expose the existing recursive pane-size reset as a command-palette
action, so it can be invoked outside of vim mode. The center pane grid's
sizes can already be evened out by double-clicking a divider, or via
vim::ResetPaneSizes (ctrl-w =) when vim mode is on, but there was no
general action for it.

The new workspace::ResetPaneSizes resets every axis in the center pane
group to equal sizes, preserving the split layout. It reuses the same
Workspace::reset_pane_sizes path the vim binding does. Docks and the
terminal panel are left untouched (they have their own reset actions).
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 10, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jun 10, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:workspace Feedback for workspace management, layout, interactions, etc label Jun 11, 2026

@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!

@ChristopherBiscardi ChristopherBiscardi self-assigned this Jun 11, 2026
@ChristopherBiscardi
ChristopherBiscardi added this pull request to the merge queue Jun 11, 2026
Merged via the queue into zed-industries:main with commit dde7c1c Jun 11, 2026
53 checks passed
This was referenced Jun 18, 2026
@42piratas
42piratas deleted the reset-pane-sizes branch June 21, 2026 14:20
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
## Summary

Exposes the existing recursive pane-size reset as a command-palette
action, so it can be invoked outside of vim mode.

The center pane grid's sizes can already be evened out by
double-clicking a divider, or via `vim::ResetPaneSizes` (`ctrl-w =`)
when vim mode is on, but there is no general action for it — so users
not in vim mode have no discoverable way to undo a drifted split layout
in one step.

## How it works

`workspace::ResetPaneSizes` (palette: "workspace: reset pane sizes")
calls the existing `Workspace::reset_pane_sizes`, which resets every
`PaneAxis` in the center pane group to equal flexes, recursing into
nested splits. The split structure is preserved — no panes are added,
removed, or rearranged, only their sizes are equalized. This is the same
path the vim `ctrl-w =` binding and the divider double-click already
use.

## Out of scope

- Docks (left/right/bottom panels) — they keep their existing `Reset
Active Dock Size` / `Reset Open Docks Size` actions.
- The terminal panel's internal splits — it is a separate panel, not
part of the center pane group.
- No default keybinding (palette-only); vim users keep `ctrl-w =`.

## Testing

Added `test_reset_pane_sizes`: builds a nested split (a horizontal axis
of three panes whose last child is a vertical split), skews every axis's
flexes, dispatches the action, and asserts every axis returns to uniform
sizes.

Release Notes:

- Added a `workspace: reset pane sizes` command that equalizes the sizes
of all panes in the center group
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
## Summary

Exposes the existing recursive pane-size reset as a command-palette
action, so it can be invoked outside of vim mode.

The center pane grid's sizes can already be evened out by
double-clicking a divider, or via `vim::ResetPaneSizes` (`ctrl-w =`)
when vim mode is on, but there is no general action for it — so users
not in vim mode have no discoverable way to undo a drifted split layout
in one step.

## How it works

`workspace::ResetPaneSizes` (palette: "workspace: reset pane sizes")
calls the existing `Workspace::reset_pane_sizes`, which resets every
`PaneAxis` in the center pane group to equal flexes, recursing into
nested splits. The split structure is preserved — no panes are added,
removed, or rearranged, only their sizes are equalized. This is the same
path the vim `ctrl-w =` binding and the divider double-click already
use.

## Out of scope

- Docks (left/right/bottom panels) — they keep their existing `Reset
Active Dock Size` / `Reset Open Docks Size` actions.
- The terminal panel's internal splits — it is a separate panel, not
part of the center pane group.
- No default keybinding (palette-only); vim users keep `ctrl-w =`.

## Testing

Added `test_reset_pane_sizes`: builds a nested split (a horizontal axis
of three panes whose last child is a vertical split), skews every axis's
flexes, dispatches the action, and asserts every axis returns to uniform
sizes.

Release Notes:

- Added a `workspace: reset pane sizes` command that equalizes the sizes
of all panes in the center group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace Feedback for workspace management, layout, interactions, etc cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants