Fix issue where having conflicting pattern items in the search query
could lead to erroneous results. For example, if the search query was
`test\c\C\c`, one would expect for the case sensitivity option to be
disabled, seeing as `\c` is the last pattern item. However, since the
code was simply iterating over `PATTERN_ITEMS`, it did not take into
consideration that:
1. The same pattern item could appear more than once in the query 2. The
order of the pattern item in the query should take precedence over the
order of the pattern item in `PATTERN_ITEMS`
As such, this commit fixes that so that the implementation actually
iterates over the pattern items capture in the query, ensuring that, if
`\c\C\c` is found, the last pattern item is the one that will be
applied.
This commit fixes an issue with the pattern items implementation where,
in vim mode, deploying the buffer search through `/` and then typing any
character would automatically disable the regex setting. After some
research this was tracked down to the fact that the `default_options`
don't actually contain all of the settings that are enabled when the
buffer search bar is shown with `/`, as the vim layer is the one that
ends up calling the `set_search_options` method with the
`SearchOptions::REGEX` option enabled. Calling this method doesn't
actually update the `default_options`, and I believe this should
probably not be changed.
As such, in order to prevent this issue, this commit introduces a new
`pattern_item_options` vector to the `BufferSearchBar`, which simply
keeps track of the search options that were either enabled/disabled by
pattern items in the search query, that actually had impact on the
search options. By keeping track of this, one can easily just revert the
options, by calling `toggle_search_option`, seeing as we only keep track
of the ones that actually had any effect on the options, and revert to
all of the options that were enabled when the buffer search bar was
deployed, be it on the `default_options` or not.
I believe the current implementation can probably be improved with a
simple `SearchOptions` and then using the `exclusion` or `intersection`
methods but have yet to dedicate more time to this. On the other hand,
there's yet another issue that surfaced while working on this:
1. Type `Main\c\C\c` in the search query 2. Confirm that
case-sensitivity is enabled
This happens because we're not actually keeping track of the order the
pattern items are applied in the search query, so the order they're
defined in `PATTERN_ITEMS` takes precendence, we'll likely need to
capture the matches so we can then actually leverage the order to
determine what the final option should be.
Add a very simple test that verifies the behaviour of
`apply_pattern_items` when the search query is updated. In practice it
would be best to be able to actually simulate the whole flow where
`EditorEvent::Edited` is triggered but I haven't managed to figure out
how to do that just yet.
This might be a bit of an overkill for the time being, but I expect that
when the array of pattern items grows, it might be faster to replace the
pattern items with a regex instead of iterating over the array.
Update the way the search query in the buffer search bar is handled in
order to support pattern items. Right now only two pattern items are
supported:
- `\c` – When \c is provided in the search query, it disables the case
sensitivity search option
- `\C` – When \C is provided in the search query, it enables the case
sensitivity search option
This feature takes precedence over the `BufferSearchBar.search_options`,
but it ensures that, if any search option was previously
enabled/disabled and it was disabled/enabled by a pattern item, it'll
return to its initial state when the pattern item is deleted.
Previously, we wouldn't finalize the diff if an error occurred during
editing or the tool call was canceled.
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Closes #ISSUE
Release Notes:
- The environment of original remote dev cannot be changed without sudo
because of the behavior of "sh -c". This PR changes "sh -c" to "sh -lc"
to let the shell source $HOME/.profile and support customized
environment like customized $PATH variable.
Related #4642
Compatible with #34136
Release Notes:
- Helix: `Shift+R` works as Paste instead of taking you to ReplaceMode
- Helix: `g .` goes to last modification place (similar to `. in vim)
Closes#33736
Use `thiserror` to implement error stack and `anyhow` to report is to
user.
Also move some code from main to remote_server to have better crate
isolation.
Release Notes:
- N/A
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Support to show diagnostics on the tab switcher in the same way they are
displayed on the tab bar. This follows the setting
`tabs.show_diagnostics`.
This will improve user experience when disabling the tab bar and still
being able to see the diagnostics when switching tabs
Preview:
<img width="768" height="523" alt="Screenshot From 2025-07-16 11-02-42"
src="https://github.com/user-attachments/assets/308873ba-0458-485d-ae05-0de7c1cdfb28"
/>
Release Notes:
- Added diagnostics indicators to the tab switcher
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Adds support for per-session prompt capabilities and capability changes
on the Zed side (ACP itself still only has per-connection static
capabilities for now), and uses it to reflect image support accurately
in 1PA threads based on the currently-selected model.
Release Notes:
- N/A
Reverts zed-industries/zed#36012
We thought we didn't need this UI, but it turns out it was load bearing
:)
Release Notes:
- Restored the zoomed panel padding
Using prompt injection, the agent may be tricked into making a fetch
request that includes unexpected data from the conversation in the URL.
As agent conversations may contain sensitive information (like private
code, or
potentially even API keys), this seems bad.
The easiest way to prevent this is to require the user to look at the
URL
before the model is allowed to fetch it.
Thanks to @ant4g0nist for bringing this to our attention.
Release Notes:
- agent panel: The fetch tool now requires confirmation.
A beta user reported that following was "lost" when asking for
confirmation, I
suspect they moved their cursor in the agent file while reviewing the
change.
Now we will resume following when the agent starts up again.
Release Notes:
- N/A
In the thread view, when focusing on the user message, we display the
editing control container absolutely-positioned in the top right.
However, if there are no rules items and no restore checkpoint button
_and_ it is the very first message, the editing controls container would
be cut-off. This PR fixes that by giving it a bit more top padding.
Release Notes:
- N/A
We were rendering a Markdown link like `[Read file x.rs (lines
Y-Z)](@selection)` while the tool ran, but then switching to just `x.rs`
as soon as we got the file location from the tool call (due to an
if/else in the UI code that applies to all tools). This caused a
flicker, which is fixed by having `initial_title` return just the
filename from the input as it arrives instead of a link that we're going
to stop rendering almost immediately anyway.
Release Notes:
- N/A