xj and xj
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
..
2026-02-24 09:24:38 +00:00
2026-01-21 13:40:42 -03:00
2026-02-18 15:49:36 -03:00
2026-02-10 16:03:46 -03:00
2026-02-23 18:39:48 +01:00
2026-02-18 13:47:10 +00:00
2026-02-12 15:46:10 -05:00
2026-02-24 09:24:38 +00:00
2026-02-17 10:41:10 +00:00
2026-02-20 09:47:00 +00:00
2026-02-18 12:00:02 +01:00
2025-10-17 18:58:14 +00:00
2026-01-26 23:56:55 +00:00
2026-02-06 20:14:35 +01:00
2026-02-20 10:17:22 +00:00
2026-02-23 13:28:39 +01:00
2026-02-13 20:16:11 +01:00
2025-11-11 12:55:19 +00:00
2026-02-19 10:41:16 -03:00
2025-10-17 18:58:14 +00:00
2026-02-19 07:23:27 +01:00
2026-02-06 20:21:19 +00:00
2026-02-20 17:11:30 -05:00
2026-02-24 11:19:34 +00:00
2026-01-07 12:48:24 -08:00
2026-02-20 08:32:45 +00:00
2026-02-23 18:42:51 +00:00
2026-02-18 14:20:30 +01:00
2026-02-19 22:13:38 -05:00
2026-02-21 01:20:05 +00:00
2026-02-18 14:30:40 -05:00
2026-02-05 17:34:34 -05:00
2026-02-24 11:19:34 +00:00
2026-02-23 10:20:31 -05: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-19 18:57:49 +01:00
2026-01-30 21:26:13 +00:00
2026-02-13 20:16:11 +01:00
2026-02-16 15:24:59 -03:00
2026-02-12 01:06:23 +00:00
2026-02-23 21:44:20 -07:00
2026-01-07 12:48:24 -08:00
2026-01-28 16:00:52 +00:00
2026-02-13 20:16:11 +01:00
2026-02-12 16:26:13 +00:00
2026-01-14 07:19:13 +00:00
2026-02-18 12:00:02 +01:00
2026-02-24 12:49:52 +01:00
2025-12-18 12:47:34 +00:00
2025-10-17 18:58:14 +00:00
2026-02-13 20:16:11 +01:00
2026-02-20 23:46:34 -05:00
2026-02-20 08:32:45 +00:00
2026-02-23 17:08:09 -08:00
2026-02-24 05:13:33 +00:00
2026-02-20 16:26:08 -05:00
2026-02-04 17:54:11 -05:00
2026-02-23 17:08:09 -08:00
2026-02-24 10:46:08 -03:00
2026-02-12 00:28:17 +00:00
2026-02-21 06:11:45 +00:00
2026-02-23 15:08:33 +00:00
2026-02-19 18:57:49 +01:00
2025-10-17 18:58:14 +00:00
2026-02-20 07:25:53 +00:00
2026-02-05 12:13:02 +00:00
2026-02-19 18:57:49 +01:00
2026-02-24 10:37:16 +00:00
2026-02-18 12:00:02 +01:00
2026-02-23 16:10:28 +01:00
2025-10-17 18:58:14 +00:00
2026-02-13 16:05:40 +00:00
2025-10-17 18:58:14 +00:00
2026-02-18 22:20:31 +00:00
2026-02-19 18:57:49 +01:00
2025-12-08 19:50:20 +01:00
2026-02-24 13:09:20 -03:00
2026-02-23 14:36:01 -03:00
2026-01-31 21:56:34 +00:00
2026-02-24 12:37:56 -03:00
2026-02-12 01:06:23 +00:00
2026-02-19 13:19:14 -05:00
2026-02-23 13:15:10 +01:00
2026-02-24 06:27:31 +00:00
2026-02-21 16:53:12 +01:00
2026-01-27 15:37:22 -03:00
2026-02-19 22:48:33 +01:00
2026-01-07 12:48:24 -08:00
2026-02-24 06:27:31 +00:00
2026-02-19 19:15:59 -05:00
2025-10-17 18:58:14 +00:00
2026-02-23 13:18:03 -07:00
2025-10-17 18:58:14 +00:00
2026-02-13 10:39:30 -03:00
2026-02-24 12:56:59 +01:00
2026-02-20 08:32:45 +00:00
2026-02-12 00:28:17 +00:00
2026-02-12 01:06:23 +00:00
2026-02-19 20:46:21 -05:00
2026-02-12 01:06:23 +00:00
2026-02-20 16:33:06 +00:00
2026-02-04 23:03:15 +01:00
2026-02-19 22:13:38 -05:00
2026-02-18 19:42:06 +01:00
2025-10-17 18:58:14 +00:00
2026-01-23 18:29:20 +01:00
2026-02-19 15:04:28 +00:00
2026-02-22 23:40:18 -05:00
2025-10-22 19:52:38 +00:00
2026-02-03 15:51:40 -05:00
2026-02-23 15:24:46 +01:00
2025-10-17 18:58:14 +00:00
2026-02-13 20:16:11 +01:00
2026-02-19 18:57:49 +01:00
2026-02-20 16:33:06 +00:00
2025-10-17 18:58:14 +00:00
2025-12-30 07:49:01 -03:00
2026-02-18 12:00:02 +01:00
2026-02-19 10:52:53 +00:00
2026-02-13 12:03:05 +00:00
2026-02-24 14:32:28 +00:00
2026-02-17 10:41:10 +00:00
2026-02-20 13:36:04 +00:00
2026-02-13 20:16:11 +01:00
2026-01-07 12:48:24 -08:00
2026-02-16 14:33:29 +00:00
2026-02-18 12:00:02 +01:00
2026-02-13 04:54:22 +00:00
2026-02-12 01:06:23 +00:00
2026-02-12 14:02:16 +00:00
2026-02-18 09:32:36 +00:00
2026-02-18 22:20:31 +00:00
2026-02-02 13:30:07 +01:00
2026-02-06 15:34:36 +00:00
2026-01-23 18:29:20 +01:00
2026-02-12 01:06:23 +00:00
2026-02-07 00:36:37 +00:00
2026-02-24 12:49:52 +01:00
2026-02-19 18:57:49 +01:00
2026-02-23 10:20:31 -05:00
2026-02-12 01:06:23 +00:00
2026-01-30 21:26:13 +00:00
2026-02-20 09:36:21 +00:00
2026-02-23 12:39:56 +01:00
2025-12-15 13:30:13 +00:00
2025-11-27 13:46:43 +00:00
2026-02-23 12:39:56 +01:00
2026-02-02 13:30:07 +01:00
2026-02-23 21:44:20 -07:00
2026-02-20 16:33:06 +00:00
2026-02-04 01:33:12 +00:00
2025-11-03 19:25:15 +00:00
2026-02-18 08:53:26 +01:00
2026-02-11 21:30:03 +02:00
2026-02-12 01:06:23 +00:00
2026-02-19 10:52:53 +00:00
2025-12-16 10:48:14 -05:00
2026-02-23 19:28:13 -05:00
2026-02-12 01:06:23 +00:00
2026-02-19 20:46:21 -05:00
2026-02-19 20:18:36 +00:00
2025-10-27 10:13:26 -04:00
2025-11-21 08:28:17 -07:00
2026-02-12 01:06:23 +00:00
2026-02-24 01:56:35 +00:00
2026-02-18 13:01:01 -05:00
2026-02-23 22:58:50 +00:00
2025-10-17 18:58:14 +00:00
2026-01-26 13:49:26 +00:00
2026-02-12 00:28:17 +00:00
2026-02-20 08:32:45 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-19 18:57:49 +01:00
2025-11-03 19:25:15 +00:00
2026-02-18 09:52:52 +00:00
2026-02-13 20:16:11 +01:00
2026-01-04 23:28:18 +00:00
2026-02-18 12:00:02 +01:00
2025-11-24 13:34:04 +01:00
2026-02-12 12:33:51 +00:00
2026-02-12 16:30:47 +00:00
2026-02-12 01:06:23 +00:00
2025-11-07 11:36:05 +00:00
2026-01-28 16:36:44 -08:00
2026-02-24 10:27:22 +00:00
2026-02-20 08:32:45 +00:00
2026-02-24 09:24:38 +00:00
2026-02-21 14:41:23 +00:00
2025-10-17 18:58:14 +00:00
2026-01-15 18:10:21 +00:00
2025-12-01 20:52:57 -07:00
2026-01-28 17:05:34 +01:00
2026-02-24 13:56:43 +00:00
2026-02-18 17:07:10 -05:00
2026-02-23 22:46:49 -03:00
2026-02-02 13:30:07 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-20 08:32:45 +00:00
2025-10-17 18:58:14 +00:00
2026-01-25 21:35:32 +01:00
2026-02-20 16:49:35 +01:00
2025-11-07 22:27:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-01-23 20:50:50 +00:00
2025-12-17 11:53:48 -07:00
2026-02-24 21:53:02 +05:30
2026-02-16 20:11:37 +00:00
2026-02-19 18:57:49 +01:00
2025-12-08 16:38:34 +01:00
2026-02-24 06:27:31 +00:00
2026-02-19 14:03:41 +01:00
2025-12-13 11:06:30 -05:00
2026-02-24 05:13:33 +00:00
2026-02-19 14:59:50 +00:00
2025-11-07 22:27:14 +00:00
2026-02-11 11:24:04 +00:00
2025-12-05 17:23:06 +00:00