-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab Switcher #7653
Comments
Jet Brains IDEA
See @alexander-irbis's comment: #7653 (comment) |
If Zed had a unified bufferline this wouldn't be an issue. |
You're right, thanks for pointing that out! I've added a link to your comment. |
If Zed supports ctrl-tab to switch between recent tabs the way VSCode and Firefox do, that will be great. |
At the moment, `Picker` always has an editor at the top, that allows the user to search list elements by text. Sometimes, the UI doesn't need such an editor. Like in the [tab switcher](#7653) that will confirm selection on the modifier keys release, so there will be no searching capabilities. This PR adds support for a "headless picker" that doesn't display an editor. It only has an invisible element to hold input focus for preventing it from jumping back to the workspace. At the moment, none of the picker implementations is made headless. It's for the future implementations. But I'd like to make it a separate PR to keep it focused on this particular feature. Release Notes: - N/A Related Issues: - Part of #7653 --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PR adds support for handling action releases — events that are fired when the user releases all the modifier keys that were part of an action-triggering shortcut. If the user holds modifiers and invokes several actions sequentially via shortcuts (same or different), only the last action is "released" when its modifier keys released. ~The following methods were added to `Div`:~ - ~`capture_action_release()`~ - ~`on_action_release()`~ - ~`on_boxed_action_release()`~ ~They work similarly to `capture_action()`, `on_action()` and `on_boxed_action()`.~ See the implementation details in [this comment](#8782 (comment)). Release Notes: - Added a fast-switch mode to the file finder: hit `p` or `shift-p` while holding down `cmd` to select a file immediately. (#8258). Related Issues: - Implements #8757 - Implements #8258 - Part of #7653 Co-authored-by: @ConradIrwin
This PR adds support for handling action releases — events that are fired when the user releases all the modifier keys that were part of an action-triggering shortcut. If the user holds modifiers and invokes several actions sequentially via shortcuts (same or different), only the last action is "released" when its modifier keys released. ~The following methods were added to `Div`:~ - ~`capture_action_release()`~ - ~`on_action_release()`~ - ~`on_boxed_action_release()`~ ~They work similarly to `capture_action()`, `on_action()` and `on_boxed_action()`.~ See the implementation details in [this comment](zed-industries#8782 (comment)). Release Notes: - Added a fast-switch mode to the file finder: hit `p` or `shift-p` while holding down `cmd` to select a file immediately. (zed-industries#8258). Related Issues: - Implements zed-industries#8757 - Implements zed-industries#8258 - Part of zed-industries#7653 Co-authored-by: @ConradIrwin
The Tab Switcher implementation (#7653): - `ctrl-tab` opens the Tab Switcher and moves selection to the previously selcted tab. It also cycles selection forward. - `ctrl-shift-tab` opens the Tab Switcher and moves selection to the last tab in the list. It also cycles selection backward. - Tab is selected and the Tab Switcher is closed on the shortcut modifier key (`ctrl` by default) release. - List items are in reverse activation history order. - The list reacts to the item changes in background (new tab, tab closed, tab title changed etc.) Intentionally not in scope of this PR: - File icons - Close buttons I will come back to these features. I think they need to be implemented in separate PRs, and be synchronized with changes in how tabs are rendered, to reuse the code as it's done in the current implementation. The Tab Switcher looks usable even without them. Known Issues: Tab Switcher doesn't react to mouse click on a list item. It's not a tab switcher specific problem, it looks like ctrl-clicks are not handled the same way in Zed as cmd-clicks. For instance, menu items can be activated with cmd-click, but don't react to ctrl-click. Since the Tab Switcher's default keybinding is `ctrl-tab`, the user can only click an item with `ctrl` pushed down, thus preventing `on_click()` from firing. fixes #7653, #7321 Release Notes: - Added Tab Switcher which is accessible via `ctrl-tab` and `ctrl-shift-tab` (#7653) (#7321) Related issues: - Unblocks #7356, I hope 😄 How it looks and works (it's only `ctrl-tab`'s and `ctrl-shift-tab`'s, no `enter`'s or mouse clicks): https://github.com/zed-industries/zed/assets/2101250/4ad4ec6a-5314-481b-8b35-7ac85e43eb92 --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Nice one! I hope a fuzzy-search feature can be added too, it is so convenient to use it after trying it in Emacs. |
@maximvl Filterable tab switcher would be very helpful. I also miss the |
I can back up what @maximvl is saying. I'm coming from emacs and being able to fuzzy search open tabs (buffers) is a massive benefit! The way the project switcher works is perfect. That's how the tab switcher should work too |
Check for existing issues
Describe the feature
When working on tabless editing mode (#6424), there was a discussion about the need to implement Tab Switcher -- a panel similar to the File Finder that would show the list of opened tabs in the active pane and allow to switch between them and close them right in this panel.
I tried to figure out how such switcher could look and how it could be implemented, and decided to file it as a separate feature request, because there's a lot of things to discuss (and probably to change in the code).
How it will look and work
ctrl-tab
. It also moves selection to the next item.ctrl
by default) or with a mouse click.Tasks
Picker
to be headless #9099How others do this
See comments below:
Related issues and PRs
The text was updated successfully, but these errors were encountered: