Cherry-picked keymap_ui: Fix bug introduced in #35208 (#35237)
Closes #ISSUE
Fixes a bug that was cherry picked onto stable and preview branches
introduced in #35208 whereby modifier keys would show up and not be
removable when editing a keybind
Release Notes:
- (preview only) Keymap Editor: Fixed an issue introduced in v0.197.2
whereby modifier keys would show up and not be removable while recording
keystrokes in the keybind edit modal
Co-authored-by: Ben Kunkle <ben@zed.dev>
Cherry-picked keymap_ui: Additional keystroke input polish (#35208)
Closes #ISSUE
Fixed various issues and improved UX around the keystroke input
primarily when used for keystroke search.
Release Notes:
- Keymap Editor: FIxed an issue where the modifiers used to activate
keystroke search would appear in the keystroke search
- Keymap Editor: Made it possible to search for repeat modifiers, such
as a binding with `cmd-shift cmd`
- Keymap Editor: Made keystroke search matches match based on ordered
(not necessarily contiguous) runs. For example, searching for `cmd
shift-j` will match `cmd-k cmd-shift-j alt-q` and `cmd-i g shift-j` but
not `alt-k shift-j` or `cmd-k alt-j`
- Keymap Editor: Fixed the clear keystrokes binding (`delete` by
default) not working in the keystroke input
Co-authored-by: Ben Kunkle <ben@zed.dev>
Someone encountered this in production, which should not happen:
<img width="1266" height="623" alt="Screenshot 2025-07-24 at 10 38
40 AM"
src="https://github.com/user-attachments/assets/40f3f977-5110-4808-a456-7e708d953b3b"
/>
This moves certain errors into the category of "never retry" and reduces
the number of retries for some others. Also it adds some diagnostic
logging for retry policy.
It's not a complete fix for the above, because the underlying issues is
that the server is sending a HTTP 403 response and although we were
already treating 403s as "do not retry" it was deciding to retry with 2
attempts anyway. So further debugging is needed to figure out why it
wasn't going down the 403 branch by the time the request got here.
Release Notes:
- N/A
Now we explicitly carve out exceptions for which HTTP responses we do
*not* retry for, and retry at least once on all others.
Release Notes:
- The Agent panel now automatically retries failed requests under more
circumstances.
There were two different underlying reasons for the issues with
ctrl-number and ctrl-punctuation:
1. Some keys in the ctrl-0..9 range send codes in the `\1b`..`\1f`
range. For example, `ctrl-2` sends keycode for `ctrl-[` (0x1b), but we
want to map it to `2`, not to `[`.
2. `ctrl-[` and four other ctrl-punctuation were incorrectly mapped,
since the expected conversion is by adding 0x40
Closes#35012
Release Notes:
- N/A
Cherry-picked agent: Fix double-lease panic when clicking on thread to
jump (#34843)
Release Notes:
- N/A
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This PR splits the resize logic into separate left/right propagation
methods and improve code organization around column width adjustments.
It also allows resize to work for both the left and right sides as well,
instead of only checking the right side for room
Release Notes:
- N/A *or* Added/Fixed/Improved ...
---------
Co-authored-by: Ben Kunkle <ben@zed.dev>
Cherry-picked keymap ui: Resizable column follow up (#34955)
I cherry picked a small fix that didn't get into the original column
resizable branch PR because I turned on auto merge.
Release Notes:
- N/A
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
This change dims rows in the keymap editor for which the corresponding
keybind is overridden by other keybinds coming from higher priority
sources.
Release Notes:
- N/A
This PR adds resizable columns to the keymap editor and the ability to
double-click on a resizable column to set a column back to its default
size.
The table uses a column's width to calculate what position it should be
laid out at. So `column[i]` x position is calculated by the summation of
`column[..i]`. When resizing `column[i]`, `column[i+1]`’s size is
adjusted to keep all columns’ relative positions the same. If
`column[i+1]` is at its minimum size, we keep seeking to the right to
find a column with space left to take.
An improvement to resizing behavior and double-clicking could be made by
checking both column ranges `0..i-1` and `i+1..COLS`, since only one
range of columns is checked for resize capacity.
Release Notes:
- N/A
---------
Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Cherry-picked Fix redo after noop format (#34898)
Closes#31917
Previously, as of #28457 we used a hack, creating an empty transaction
in the history that we then merged formatting changes into in order to
correctly identify concurrent edits to the buffer while formatting was
happening. This caused issues with noop formatting however, as using the
normal API of the buffer history (in an albeit weird way) resulted in
the redo stack being cleared, regardless of whether the formatting
transaction included edits or not, which is the correct behavior in all
other contexts.
This PR fixes the redo issue by codifying the behavior formatting wants,
that being the ability to push an empty transaction to the history with
no other side-effects (i.e. clearing the redo stack) to detect
concurrent edits, with the tradeoff being that it must then manually
remove the transaction later if no changes occurred from the formatting.
The redo stack is still cleared when there are formatting edits, as the
individual format steps use the normal `{start,end}_transaction` methods
which clear the redo stack if the finished transaction isn't empty.
Release Notes:
- Fixed an issue where redo would not work after buffer formatting
(including formatting on save) when the formatting did not result in any
changes
Co-authored-by: Ben Kunkle <ben@zed.dev>
Cherry-picked Fix an issue where xkb defined hotkeys for arrows would
not work (#34823)
Addresses
https://github.com/zed-industries/zed/pull/34053#issuecomment-3096447601
where custom-defined arrows would stop working in Zed.
How to reproduce:
1. Define custom keyboard layout
```bash
cd /usr/share/X11/xkb/symbols/
sudo nano mykbd
```
```
default partial alphanumeric_keys
xkb_symbols "custom" {
name[Group1]= "Custom Layout";
key <AD01> { [ q, Q, Escape, Escape ] };
key <AD02> { [ w, W, Home, Home ] };
key <AD03> { [ e, E, Up, Up ] };
key <AD04> { [ r, R, End, End ] };
key <AD05> { [ t, T, Tab, Tab ] };
key <AC01> { [ a, A, Return, Return ] };
key <AC02> { [ s, S, Left, Left ] };
key <AC03> { [ d, D, Down, Down ] };
key <AC04> { [ f, F, Right, Right ] };
key <AC05> { [ g, G, BackSpace, BackSpace ] };
// include a base layout to inherit the rest
include "us(basic)"
};
```
2. Activate custom layout with win-key as AltGr
```bash
setxkbmap mykbd -variant custom -option lv3:win_switch
```
3. Now Win-S should produce left arrow, Win-F right arrow
4. Test whether it works in Zed
Release Notes:
- linux: xkb-defined hotkeys for arrow keys should behave as expected.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Sergei Surovtsev <97428129+stillonearth@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Closes#32675
Exactly the same changes as in #33640 by @sviande
The PR has been in WIP state for 3 weeks with no activity, and the issue
basically makes Mistral models unusable. I have tested the changes
locally, and it does indeed work. Full credit goes to @sviande, I just
want this feature to be finished.
Release Notes:
- agent: Fixed an issue with tool calling with the Mistral provider
(thanks [@sviande](https://github.com/sviande) and
[@armyhaylenko](https://github.com/armyhaylenko))
Co-authored-by: sviande <sviande@gmail.com>
Cherry-picked keymap_ui: Auto complete action arguments (#34785)
Supersedes: #34242
Creates an `ActionArgumentsEditor` that implements the required logic to
have a JSON language server run when editing keybinds so that there is
auto-complete for action arguments.
This is the first time action argument schemas are required by
themselves rather than inlined in the keymap schema. Rather than add all
action schemas to the configuration options we send to the JSON LSP on
startup, this PR implements support for the
`vscode-json-language-server` extension to the LSP whereby the server
will request the client (Zed) to resolve URLs with URI schemes it does
not recognize, in our case `zed://`. This limits the impact on the size
of the configuration options to ~1KB as we send URLs for the language
server to resolve on demand rather than the schema itself. My
understanding is that this is how VSCode handles JSON schemas as well. I
plan to investigate converting the rest of our schema generation logic
to this method in a follow up PR.
Co-Authored-By: Cole <cole@zed.dev>
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Co-authored-by: Ben Kunkle <ben@zed.dev>
Closes#27118Closes#34165
Fix a small issue after we landed
https://github.com/zed-extensions/ruby/pull/113+ where we introduced
`HTML/ERB` and `YAML/ERB` language IDs to improve user experience. Sorry
about that. Thanks!
Release Notes:
- N/A
This PR fixes an issue where the topmost header in a multibuffer would
jump when the corresponding buffer was folded.
The issue arose because for the topmost header, the offset within the
scroll anchor is negative, as the corresponding buffer only starts below
the header itself and thus the offset for the scroll position has to be
negative.
However, upon collapsing that buffer, we end up with a negative vertical
scroll position, which causes all kinds of different problems. The issue
has been present for a long time, but became more visible after
https://github.com/zed-industries/zed/pull/34295 landed, as that change
removed the case distinction for buffers scrolled all the way to the
top.
This PR fixes this by clamping just the vertical scroll position upon
return, which ensures the negative offset works as expected when the
buffer is expanded, but the vertical scroll position does not turn
negative once the buffer is folded.
Release Notes:
- Fixed an issue where folding the topmost buffer in a multibuffer would
cause the header to jump slightly.
Reverts zed-industries/zed#29718
We've noticed some issues with Zed on Intel-based Macs where typing has
become sluggish, and git bisect has seemed to point towards this PR.
Reverting for now, until we can understand why it is causing this issue.
Cherry-picked keymap_ui: Don't panic on `KeybindSource::from_meta`
(#34652)
Closes #ISSUE
Log error instead of panicking when `from_meta` is passed an invalid
value
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Co-authored-by: Ben Kunkle <ben@zed.dev>
Cherry-picked keymap_ui: Fix various keymap editor issues (#34647)
This PR tackles miscellaneous nits for the new keymap editor UI.
Release Notes:
- N/A
---------
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Now we only auto-retry if burn mode is enabled. We also show a "Retry"
button (so you don't have to type "continue") if you think that's the
right remedy, and additionally we show a "Retry and Enable Burn Mode"
button if you don't have it enabled.
<img width="484" height="260" alt="Screenshot 2025-07-17 at 6 25 27 PM"
src="https://github.com/user-attachments/assets/dc5bf1f6-8b11-4041-87aa-4f37c95ea9f0"
/>
<img width="478" height="307" alt="Screenshot 2025-07-17 at 6 22 36 PM"
src="https://github.com/user-attachments/assets/1ed6578a-1696-449d-96d1-e447d11959fa"
/>
Release Notes:
- Only auto-retry Agent requests when Burn Mode is enabled
Cherry-picked keymap ui: Fix keymap editor search bugs (#34579)
Keystroke input now gets cleared when toggling to normal search mode
Main search bar is focused when toggling to normal search mode
This also gets rid of highlight on focus from keystroke_editor because
it also matched the search bool field and was redundant
Release Notes:
- N/A
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
@probably-neb I guess we should be opening the keymap editor from title
bar and menu as well. I believe this got missed in this: #34568.
Release Notes:
- Open Keymap editor from settings from menu and title bar.
Keystroke input now gets cleared when toggling to normal search mode
Main search bar is focused when toggling to normal search mode
This also gets rid of highlight on focus from keystroke_editor because
it also matched the search bool field and was redundant
Release Notes:
- N/A
Cherry-picked keymap_ui: Show edit icon on hovered and selected row
(#34630)
Closes #ISSUE
Improves the behavior of the edit icon in the far left column of the
keymap UI table. It is now shown in both the selected and the hovered
row as an indicator that the row is editable in this configuration. When
hovered a row can be double clicked or the edit icon can be clicked, and
when selected it can be edited via keyboard shortcuts. Additionally, the
edit icon and all other hover tooltips will now disappear when the table
is navigated via keyboard shortcuts.
<details><summary>Video</summary>
https://github.com/user-attachments/assets/6584810f-4c6d-4e6f-bdca-25b16c920cfc
</details>
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Co-authored-by: Ben Kunkle <ben@zed.dev>
Cherry-picked keymap_ui: Improve keybind display in menus (#34587)
Closes #ISSUE
Defines keybindings for `keymap_editor::EditBinding` and
`keymap_editor::CreateBinding`, making sure those actions are used in
tooltips.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
---------
Co-authored-by: Finn <dev@bahn.sh>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Finn <dev@bahn.sh>
Cherry-picked agent: Disable `project_notifications` by default (#34615)
This tool needs more polishing before being generally available.
Release Notes:
- agent: Disabled `project_notifications` tool by default for the time
being
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
This PR improves Keystroke search by:
1. Allow searching by modifiers without additional keys.
2. Take match count into consideration when deciding if we should show
an action as a search match.
3. Take order into consideration as well.
Release Notes:
- N/A
---------
Co-authored-by: Ben Kunkle <ben@zed.dev>
Closes #ISSUE
This change applies both to the UI (we render `<null>` as muted text
instead of `zed::NoAction`) as well as how we update the keymap file
(the duplicated binding is bound to `null` instead of `"zed::NoAction"`)
Release Notes:
- N/A *or* Added/Fixed/Improved ...