Files
zed/crates
xjandxj 072589765b workspace: Add ActivateLastPane action (#49853)
## Summary

Add `workspace::ActivateLastPane` so users can bind a shortcut (for
example `cmd-9`) to focus the last pane.

## Why

Today, the closest option is `workspace::ActivatePane` with an index
(for example `8`), but that has side effects: when the index does not
exist, it creates/splits panes (`activate_pane_at_index` fallback).

`ActivateLastPane` gives a stable, no-surprises target: focus the
rightmost/last pane in current pane order, never create a new pane.

## Context

This capability has been requested by users before:
- https://github.com/zed-industries/zed/issues/17503#event-22959656321

## Prior art

VS Code exposes explicit editor-group focus commands and index-based
focus patterns (e.g. `workbench.action.focusSecondEditorGroup` ...
`focusEighthEditorGroup`) in its workbench commands:
-
https://github.com/microsoft/vscode/blob/main/src/vs/workbench/browser/parts/editor/editorCommands.ts#L675-L724

Zed already follows numbered pane focus in default keymaps
(`ActivatePane` 1..9 on macOS/Linux/Windows), so adding a dedicated
"last pane" action is a small, natural extension:
- `assets/keymaps/default-macos.json`
- `assets/keymaps/default-linux.json`
- `assets/keymaps/default-windows.json`

## Change

- Added `workspace::ActivateLastPane`
- Implemented `Workspace::activate_last_pane(...)`
- Wired action handler in workspace listeners
- Added `test_activate_last_pane`

## Validation

- `cargo test -p workspace test_activate_last_pane -- --nocapture`
- `cargo test -p workspace test_pane_navigation -- --nocapture`
- `cargo fmt --all -- --check`

## Risk

Low: focus-only behavior, no layout/data changes, no default keymap
changes.

Release Notes:

- Added `workspace::ActivateLastPane` action for keybindings that focus
the last pane.

---------

Co-authored-by: xj <gh-xj@users.noreply.github.com>
2026-02-24 21:53:02 +05:30
..
2025-10-17 18:58:14 +00:00
2026-02-23 18:42:51 +00:00
2026-02-18 14:20:30 +01:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2026-02-19 19:15:59 -05:00
2026-02-12 01:06:23 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2025-11-07 11:36:05 +00:00
2026-02-24 13:56:43 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00