Follow-up of https://github.com/zed-industries/zed/pull/25766
Fixes the bugs found:
* modifier toggle not happening instantly due to `edit_debounce_ms`
considered
* hint update race that ignored the cache clear
Release Notes:
- N/A
When reviewing hunks, scroll to put them at the center of the screen
so you can better see the context around that hunk.
The field `center_cursor` was added to the actions `editor::GoToHunk`
and `editor::GoToPrevHunk`, this was set to `false` by default in
keymaps, as it wouldn't help with in-editor navigation.
The field is set to `true` for when you trigger `git::StageAndNext`
and `git::UnstageAndNext`, this is also `true` for the buttons in the
Diff View toolbar.
Release Notes:
- N/A
This PR adds the `whole_excerpt` field to the actions:
- `git::StageAndNext`
- `git::UnstageAndNext`
Which is set by false by default, effectively, now staging and unstaging
with these actions is done hunk-by-hunk, this also affects the `Stage`
and
`Unstage` buttons in the Diff View toolbar.
A caveat: with this PR, there is no way to configure the buttons in the
Diff
View toolbar to restore the previous behavior, if we want, I think we
can make
it a setting, but let's see if anyone really wants that.
Release Notes:
- N/A
Closes#25315
Release Notes:
- Fixes an issue where the buffer search options would not be reset when
using `buffer: deploy search` after using Vim search (`*` & `#`) which
enable all search options
Closes#25304
Release Notes:
- Fixed an issue where `active_pane_modifiers` settings would be applied
to a parent pane if one of it's child panes was active
This PR makes it so we include some textual content in the user messages
that as used to send up tool results.
I observed that when sending up the tool results with no text, it would
lead the model to start replying with no text, which would then result
in an error when attaching later tool results.
I think there's a deeper issue at play here, but for now we just include
some text to keep the model on track.
Release Notes:
- N/A
This PR adds an optimistic update when staging or unstaging diff hunks.
In the process, I've also refactored the logic for staging and unstaging
hunks, to consolidate more of it in the `buffer_diff` crate.
I've also changed the way that we treat untracked files. Previously, we
maintained an empty diff for them, so as not to show unwanted
entire-file diff hunks in a regular editor. But then in the project diff
view, we had to account for this, and replace these empty diffs with
entire-file diffs. This form of state management made it more difficult
to store the pending hunks, so now we always use the same
`BufferDiff`/`BufferDiffSnapshot` for untracked files (with a single
hunk spanning the entire buffer), but we just have a special case in
regular buffers, that avoids showing that entire-file hunk.
* [x] Avoid creating a long queue of `set_index` operations when
staging/unstaging rapidly
* [x] Keep pending hunks when diff is recalculated without base text
changes
* [x] Be optimistic even when staging the single hunk in added/deleted
files
* Testing
Release Notes:
- N/A
---------
Co-authored-by: Cole Miller <m@cole-miller.net>
This PR updates the ui of the git panel. It removes the header from the
panel and unifies the repository, branch and commit controls in the
bottom section.
It also adds a secondary menu to the primary button giving access to a
variety of actions for managing local and remote changes:

Known issues (will be fixed in a later pr)
- Spinner showing git operation progress was removed, will be re-added
- Clicking expand with the panel editor focused will commit (due to
shared action name. Already tracked)
Before | After

(Also adds `component`, `linkme` to cargo-machete ignore as they are
used in the `IntoComponent` proc-macro and will always be incorrectly
flagged as unused)
Release Notes:
- N/A
---------
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <53574922+cole-miller@users.noreply.github.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Closes#10004
This PR adds support for the organize imports action. Previously, you
had to manually configure it in the settings and then use format to run
it.
Note: Default key binding will be `alt-shift-o` which is similar to
VSCode's organize import. Also, because `cmd-shift-o` is taken by
outline picker.
Todo:
- [x] Initial working
- [x] Handle remote
- [x] Handle multi buffer
- [x] Can we make it generic for executing any code action?
Release Notes:
- Added `editor:OrganizeImports` action to organize imports (sort,
remove unused, etc) for supported LSPs. You can trigger it by using the
`alt-shift-o` key binding.
This PR reworks how we store tool results and refer to them later.
We now maintain a mapping of the tool uses to their corresponding
results, with separate mappings for the messages and the tool uses they
correspond to.
Release Notes:
- N/A
I've been bothered by using simple hyphens for bullet lists here for a
while; it kinda looked cheap and not well-formatted. So, in this PR, I'm
adding a new, custom UI component in the `language_models` crate, called
`InstructionListItem`, based off the `ListItem` that's somewhat
mimic'ing what a `<li>` would be on the web.
It does have a "rigid" structure as in it's always a label followed by a
button (which is optional), but that seems okay given it has been the
overall shape of the copy we've been using here. Also, never really
loved that we were pasting URLs directly, that kinda felt cheap, too. I
could see an argument where it's just clearer, but it looks too
cluttered, as URLs aren't super pretty, necessarily.
| Before | After |
|--------|--------|
| <img
src="https://github.com/user-attachments/assets/ffd1ac27-b1f4-450d-abf5-079285fc9877"
width="700px" /> | <img
src="https://github.com/user-attachments/assets/28fb9d0d-205d-45d8-9e43-1aaa947adc96"
width="700px" /> |
Release Notes:
- N/A
https://github.com/zed-industries/zed/pull/25752 with fixes on top
* Ensures no flickering happens for all modifiers `: false` case
* Dismisses the toggled state on focus out
* Reworks cache state so that "enabled" and "toggled by modifiers" are
different states with their own lifecycle
Release Notes:
- N/A
Closes#25638
We currently only check the log size limit at startup and move `Zed.log`
to `Zed.log.old`. If a user runs Zed for an extended period, there's no
runtime restriction on the log file size, which can cause it to grow to
several gigabytes.
This PR fixes that by tracking the log file size while writing. If it
exceeds a certain threshold, we perform the same log replace and
continue logging.
Release Notes:
- Fixed an issue where `Zed.log` could grow excessively large during
long sessions of Zed.
This PR replaces almost all uses of "discard" in the git panel UI with
"restore", since that's the verb we settled on for the project diff.
The only exception is in the confirmation prompt for restoring files,
where I've kept the "discard changes" language. I think consistency is
less important here and it's helpful to rephrase the action that's being
taken to emphasize that it's destructive.
Release Notes:
- N/A
Follow-up of https://github.com/zed-industries/zed/pull/25605
Previous PR made global tasks with `ZED_WORKTREE_ROOT` available for
"nothing open" scenario, this PR also gets all related worktree task
templates, using the centralized `TextContexts`' active worktree
detection.
Release Notes:
- N/A
This PR updates the comments in the `default.json` file consistently use
`//`.
Some comments were using `///`, which doesn't make sense in JSONC.
Release Notes:
- N/A
My previous #24761 and #25192 PR's changed the order of the buttons in
the title_bar for collab, the logic is kept the same but the order is
now as it was previously.
Release Notes:
- N/A
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This PR fixes an unexpected cursor position when jumping to the
beginning of the project diff editor's first excerpt if that excerpt
starts with a deleted region. Previously, the cursor would end up in the
*following* region in this situation; now it ends up at the start of the
deleted region, as happens already for excerpts that are not the first.
Release Notes:
- N/A
---------
Co-authored-by: Max <max@zed.dev>
Closes#25384
Markdown preview now subscribes to `ExcerptsEdited` event which is
emited when edit prediction is accepted.
Release Notes:
- Fixed markdown preview not updating when edit prediction is accepted.
It may happen that the column for the scroll anchor is nonzero, and the
adjustment we're doing here could result in an invalid point in that
case.
Release Notes:
- N/A
Co-authored-by: Max <max@zed.dev>
Closes: #25556
We were always comparing `disabled_globs` against the relative file
path, we'll now use the absolute path if the glob is also absolute.
Release Notes:
- Support absolute globs in `edit_predictions.disabled_globs`