Closes #12887
Release Notes:
- Fixed `x g ctrl-a` step
0x2CA
created
161f8a1
Fix "Open a file or project to get started" placeholder text not always shown (#26044)
Click to expand commit body
Check that there are no `visible_worktrees` rather than checking
`worktrees` when deciding whether to display the "Open a file or project
to get started" text
Closes #25395
Release Notes:
- Fixed the "Open a file or project to get started" message not always
showing after all buffers have been closed
This PR adds the `git.hunk_style` setting, allowing setting an alternate
style for hunks – specifically the rendering of unstaged hunks.
It has 2 options:
- `transparent` (unstaged hunks are more transparent/less opaque than
staged hunks)
- `pattern (unstaged hunks are indicated by a visual pattern)
We'll possibly explore a VSCode-style "don't show staged hunks", but the
complexity it adds is a bit out of scope for now.
Transparent:

Pattern:

Release Notes:
- Git Beta: Added `git.hunk_style` setting to allow toggling between git
hunk visual styles.
Nate Butler
created
0ec15d6
Fix soft_wrap setting not applying to buffers starting with a different language (#25880)
Click to expand commit body
Closes #22999
# Problem
Currently, the default soft wrap mode of an editor is determined by
reading the language-specific settings of the language _at offset zero_
in the editor's (multi)buffer. While this provides a way to pick a
single soft wrap mode for a multi-language multibuffer, it's a bad
choice for a single-buffer multibuffer that begins with a different
embedded language. For example, Markdown with frontmatter:
```markdown
---
my_front_matter
---
# Hello World
```
Setting this in config:
```json
"languages": {
"Markdown": { "soft_wrap": "bounded" }
},
```
Will not soft wrap the Markdown file as the language at offset zero is
YAML.
# Solution
Instead of using the language at offset zero, use the language of the
first buffer in the multibuffer (the buffer at offset zero). This gives
better behavior for single-buffer editors, and a similar default for
multi-language multibuffers as before.
# Testing
All existing `editor` crate tests pass, but I would appreciate any
guidance for where best to add additional testing.
Release Notes:
- Fixed soft_wrap setting not applying to buffers starting with a
different language
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Alex Ozer
and
Kirill Bulatov
created
909de2c
assistant2: Use `cmd-n` to create a new prompt editor when already in a prompt editor (#25935)
Click to expand commit body
This flips the keybindings that are used to create a new thread/prompt
editor (only when you're already in a prompt editor)
Release Notes:
- N/A
Bennet Bo Fenner
created
f31749c
edit predictions: Improve UX when there's no keybinding for accepting predictions (#25815)
Click to expand commit body
If the user already binds `tab`/`alt-tab`/`alt-l` to a different action
in a conflicting context and hasn't assigned a different keybinding for
`editor::AcceptEditPrediction`, we would show broken popovers with no
bindings:

Instead, they will now see an error-variant of every popover which
includes a tooltip with a short description and buttons to open the
keymap, and open a new docs section explaining the issue in detail and
how to fix it.

Note: I included the docs change in this PR because it's ok to deploy
before the release, as it also applies to existing versions.
Release Notes:
- edit predictions: Improve UX when there's no keybinding for accepting
predictions
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo <danilo@zed.dev>
Agus Zubiaga
,
Danilo Leal
, and
Danilo
created
76a8160
Reuse existing logic used to generate commit messages to disable commit buttons (#26034)
Click to expand commit body
Also
- Recomputes `suggested_commit_message` and no longer stores it, to
ensure things are always up to date
- Reduces indentation in `render_footer`
Release Notes:
- N/A
Joseph T. Lyons
created
7d22059
migration: Add for `editor::GoToHunk` and `editor::GoToPrevHunk` actions (#26017)
Click to expand commit body
We modified few actions in
https://github.com/zed-industries/zed/pull/25846, which are:
`"editor::GoToHunk" -> ["editor::GoToHunk", { "center_cursor": true }]`
`"editor::GoToPrevHunk" -> ["editor::GoToPrevHunk", { "center_cursor":
true }]`
Also, recently we changed and added migration for:
`["editor::GoToPrevHunk", { "center_cursor": true }] ->
["editor::GoToPreviousHunk", { "center_cursor": true }] `
This means:
1. User that might still have `editor::GoToHunk` won't be automatically
migrated to `["editor::GoToHunk", { "center_cursor": true }]`. Note
value of `center_cursor` is false, in first case (default), and true in
second case.
2. User that might still have `editor::GoToPrevHunk` won't be
automatically migrated to `["editor::GoToPreviousHunk", {
"center_cursor": true }]`. Note, `editor::GoToPrevHunk` is renamed
since, it is now invalid action.
This PR adds those migrations.
cc: @marcospb19
Release Notes:
- N/A
smit
created
6b16a55
Fix lost focus when navigating back in project search result (#22483)
Click to expand commit body
Closes #22447
When navigate forward/back, the focus moves from the ProjectSearchView's
result editor to the Pane, and then move to the ProjectSearchView, but
the event `on_focus_in` not triggered for ProjectSearchView, causing the
result editor to lose focus eventually.
https://github.com/zed-industries/zed/blob/f6dabadaf79bd29c89c8d55a1e9f1d33236f736e/crates/workspace/src/workspace.rs#L1372
https://github.com/zed-industries/zed/blob/f6dabadaf79bd29c89c8d55a1e9f1d33236f736e/crates/workspace/src/workspace.rs#L1385
Considering that the navigation might be triggered again in the next
frame, so use `on_next_frame` in `on_focus` event to move focus to
result editor.
Next frame:
- the blur event triggered for result editor.
- focus move from ProjectSearchView to result editor in `on_focus` event
for ProjectSearchView
- navigate again, focus moves from result editor to Pane then move back
to ProjectSearchView
- the focus not change during this frame, so no focus event happened for
ProjectSearchView.

Release Notes:
- Fix lost focus when navigate back in project search result
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
feeiyu
and
Kirill Bulatov
created
7ba2b25
Fix a panic on Linux theme appearance change (#26019)
Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/26009
https://github.com/zed-industries/zed/blob/21484a2e9d07b6285f112ba49ca413cdb8e360e4/crates/gpui/src/platform/linux/platform.rs#L517-L519
`with_common` panicked at `borrow_mut` which is the way it's implemented
for X11, Wayland and Headless Linux counterparts.
https://github.com/zed-industries/zed/blob/21484a2e9d07b6285f112ba49ca413cdb8e360e4/crates/gpui/src/platform/linux/wayland/client.rs#L722-L724
By accessing the appearance global instead of a `RefCell` with it, the
panic goes away with one notable side-effect, on Linux only: the first
global's value on `Dark` appearance would be `Light`: it becomes normal
instantly, thanks to
https://github.com/zed-industries/zed/blob/21484a2e9d07b6285f112ba49ca413cdb8e360e4/crates/workspace/src/workspace.rs#L1083-L1090
Things work without flickering:
[linux_theme_toggle.webm](https://github.com/user-attachments/assets/0e39ddc0-b4ff-4475-93ff-7b2bd7233628)
Release Notes:
- Fixed a panic on Linux theme appearance change
Kirill Bulatov
created
cbb535f
Fix completion details on new clangd versions (#25405)
Click to expand commit body
Fixes #16057
In newer versions of clangd, the switch labelDetailsSupport in the json
passed to the language server modifies the format of the returned json.
Zed handles well the old format, but misses the function parameters in
the new one. For example:
The old format looks like this:
```json
...
"label": " Window(int width, int height, const char *name, bool vsync, bool resizable)",
...
```
and with labelDetailsSupport = true:
```json
...
"label": " Window",
"labelDetails": {
"detail": "(int width, int height, const char *name, bool vsync, bool resizable)"
},
...
```
A simple solution is to just to not tell the language server that label
details are supported and force it to use the old format. This is a
dirty fix, but makes the completions behave like in the old versions of
clangd.
I do not know if this will break another language server. From what I've
found out most lsp-s do not depend on that setting and provide all
completion data either way. If not, this switch will need to be exposed
in a config or be at least lsp-dependant.
Lastly, I do not know Rust, maybe will need help to make a better fix
for the issue.
Release Notes:
- Fixed broken C++ completion suggestions
Boris Vassilev
created
20fc753
editor: Ensure correct tab icon is shown for files outside of the current project (#25933)
Click to expand commit body
Closes #25885
This PR improves the matching for file icons to tabs.
Previously, the tab icon would be resolved based upon the relative path
in the current project. However, this caused the default file icon being
assigned to all files outside of the project, as the relative path for
these files would be empty.
Instead, `path_for_buffer` is now used which always returns a proper
file name even for paths outside the current project (as also stated [in
this
comment](https://github.com/zed-industries/zed/blob/fee9c677078ad5beebe151e8350e1fc353230dc9/crates/editor/src/items.rs#L1689)).
As the file name is sufficient for matching icons to files, this fixes
the linked issue whilst not changing anything for previously properly
matched icons.
| `main` | This PR |
| --- | --- |
| <img width="296" alt="main"
src="https://github.com/user-attachments/assets/e72b8b5d-aa1c-4a8e-903f-14239f5b8764"
/> | <img width="296" alt="PR"
src="https://github.com/user-attachments/assets/a736974a-ce41-4861-be3f-95448cc7ffd0"
/> |
Release Notes:
- Fixed wrong file icons being shown for files outside of the current
project.
Finn Evers
created
042fc82
python: Fix and improve highlighting (#25813)
Click to expand commit body
Closes #25803
Closes #25707
This PR fixes the highlighting regression described in #25803 by fixing
the priorities of highlights as described in the [comment within the
file
itself](https://github.com/zed-industries/zed/blob/5b66ea15638b004c45bbf4e4dd0b576aa6cdcebc/crates/languages/src/python/highlights.scm#L1).
A nice side-effect of this is that scoped constants or other identifiers
are now also more accurately highlighted, as seen in the screenshots
below.
While I was at it, I also adressed the highlighting issue for default
typed idenfiers.
| This PR | <img width="575" alt="PR"
src="https://github.com/user-attachments/assets/aed5cdd0-c31a-4794-8128-376944fddd2d"
/> |
| --- | --- |
| Preview | <img width="575" alt="preview"
src="https://github.com/user-attachments/assets/ae3fad35-d436-472c-aff0-16508304ccf7"
/> |
| Stable | <img width="575" alt="stable"
src="https://github.com/user-attachments/assets/3836427c-f1cc-42ea-b1a7-8f5bbbadf210"
/> |
Release Notes:
- Fixed constants not being highlighted in Python-files.
- Improved Python-highlighting for default function arguments and scoped
identifiers.
Finn Evers
created
27781a8
html: Add injections for `style` attributes and event handler attributes (#23659)
33af6bc
Make suggested commits placeholders and allow them to be committed (#26006)
Click to expand commit body
This does not fix the bug where, when the commit editor modal is open,
changing the staged file does not update the suggested message in the
commit editor. Conrad mentioned he thought we shouldn't be allowed to
change those when the modal is open, so I'm not attempting to fix that.
Release Notes:
- Made suggested commits placeholders and allow them to be committed.
Joseph T. Lyons
created
563baf6
Disable diff hunks for untracked files, even w/ no newline at eof (#25980)
Click to expand commit body
This fixes an issue where diff hunks were shown for untracked files, but
only if the files did not end with a newline.
Release Notes:
- N/A
Max Brunsfeld
created
11b79d0
workspace: Add trailing `/` to directories on completion when using `OpenPathPrompt` (#25430)
Click to expand commit body
Closes #25045
With the setting `"use_system_path_prompts": false`, previously, if the
completion target was a directory, no separator would be added after it,
requiring us to manually append a `/` or `\`. Now, if the completion
target is a directory, a `/` or `\` will be automatically added. On
Windows, both `/` and `\` are considered valid path separators.
https://github.com/user-attachments/assets/0594ce27-9693-4a49-ae0e-3ed29f62526a
Release Notes:
- N/A
张小白
created
8c4da9f
Disable Git panel button to open commit editor in certain cases (#26000)
Click to expand commit body
Also:
- Internally renames a bit of code to make it easy to identify between
when we are disabling the buttons that open and close the modal editor
(in Git Panel and Project Diff) vs when we are disabling the commit
buttons (in Git Panel and Git commit editor modal).
- Deletes some unused code.
Release Notes:
- Unified disabling / enabling the button to open the Git commit editor
modal in the Git panel with the Project Diff commit button.
- Unified disabling / enabling the commit buttons, for the same cases,
between the Git panel and Git commit editor modal.
Closes #25951
Release Notes:
- git: Update "enter" in the list of changed files to preserve focus. If
you want the old behaviour, hit enter twice.
- git: Follow the cursor, not the scroll anchor, in the list. Although
the scroll anchor was nice for passive scrolling, it broke if you had
changed the overflow scroll settings.
Conrad Irwin
created
ffe2bed
Refactor more code around commit button text (#25990)
Click to expand commit body
Missed this when doing https://github.com/zed-industries/zed/pull/25988
Release Notes:
- N/A
Joseph T. Lyons
created
8894073
Use same commit button text in panel and modal (#25988)
Click to expand commit body
Release Notes:
- Fixed inconsistencies in commit button text between Git panel and modal.
Joseph T. Lyons
created
74fc52d
Git Beta: Fix a few cases of empty toasts showing up (#25985)
Click to expand commit body
Improve parsing of git remote outputs
Release Notes:
- N/A
Updates #25835
Updates #25951
Closes #ISSUE
Release Notes:
- Fixed toggling folds from within deleted hunks
Conrad Irwin
created
c03bf1a
gpui: Ensure hitbox is inserted when element has hover listener (#25981)
Click to expand commit body
Currently, when an element has only a hover listener, the attached
listener will never trigger, because within the check for whether a
hitbox has to be inserted for the given element, this case it not
considered.
That leads to the behaviour as described in
https://github.com/zed-industries/zed/pull/25602#discussion_r1970720972,
where another event listener has to be attached to the element in order
for the hover listener to work.
This PR fixes the issue by ensuring that a hitbox is also inserted when
only a hover listener is attached to the element.
Release Notes:
- N/A
Finn Evers
created
922aaa0
Show git panel footer even when on a detached HEAD (#25968)
Click to expand commit body
Previously, the git panel footer would accidentally hide when not on a
branch.
Release Notes:
- N/A
Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
Max Brunsfeld
and
Ben Kunkle
created
fc5ff31
markdown: Change the copy icon to a check once copied (#25970)
Click to expand commit body
This PR makes it so the copy icon on code blocks will change to a check
once the code block has been copied.
Release Notes:
- N/A
Marshall Bowers
created
e7b3b8b
git: Use worktree paths in the panel (#25950)
Click to expand commit body
This PR changes the git panel to use worktree-relative paths for its
entries, instead of repository-relative paths as before. Paths that lie
outside the active repository's worktree are no longer shown in the
panel. Note that in both respects this is how the project diff editor
already works, so this PR brings those two pieces of UI into harmony.
Release Notes:
- N/A
In #25005 we added regex syntax highlighting to search; but the existing
regex grammar highlighted every character as a string which was hard to
read.
This flips so that characters are not highlighted, and brackets, etc.
are.
<img width="346" alt="Screenshot 2025-03-03 at 14 39 35"
src="https://github.com/user-attachments/assets/f7d3ae9c-fb5c-45eb-a5e9-41a330fbe940"
/>
Release Notes:
- Fixed regex search box being overly green
Conrad Irwin
created
0776fa8
markdown: Allow code blocks and tables to be horizontally scrollable (#25956)
Click to expand commit body
This PR adds the ability for Markdown code blocks and tables to be made
horizontally scrollable.
This is a feature that the caller can opt in to.
Right now we're using it for the rendered Markdown in the Assistant 2
panel.
Release Notes:
- N/A
Marshall Bowers
created
7321c81
gpui: Add `restrict_scroll_to_axis` to match web scrolling behavior (#25963)
Click to expand commit body
This PR adds a new `restrict_scroll_to_axis` style to allow consumers to
opt-in to the scrolling behavior found on the web.
When this is enabled the behavior will be such that:
- Scrolling using the mouse wheel will only scroll the Y axis
- Scrolling using the mouse wheel with <kbd>Shift</kbd> held will only
scroll the X axis
This behavior is useful in scenarios where you have some
vertically-scrollable content that is interspersed with
horizontally-scrollable elements, as otherwise the scroll will be
constantly hijacked by the horizontally-scrollable elements while trying
to scroll up and down in the vertically-scrollable container.
I think that this behavior should be the default, but it's a bit of a
sweeping change to make all at once, so for now it remains opt-in.
Release Notes:
- N/A
Marshall Bowers
created
ac3cb3d
git_ui: horizontal is not vertical (#25961)
Click to expand commit body
Fixes an issue where I was missing some brain cells and changed the git
panel's `render_entries` to a `v_flex` instead of an `h_flex`.
But actually, fixes the git panel entries from disappearing when a
scrollbar is rendered.
**Before**

**After**

Closes #25955
Release Notes:
- Git Beta: Fixed an issue where when the git panel would need to scroll
all the items are pushed off the screen.
Nate Butler
created
0bd40da
vim: Fix key navigation on folded buffer headers (#25944)
Click to expand commit body
Closes #24243
Release Notes:
- vim: Fix j/k on folded multibuffer headers
---------
Co-authored-by: João Marcos <marcospb19@hotmail.com>
Conrad Irwin
and
João Marcos
created
3bec4eb
markdown: Add initial support for tables (#25954)
Click to expand commit body
This PR adds initial support for displaying tables to the `markdown`
crate.
This allows us to render tables in Assistant 2:
| Before | After |
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
| <img width="1309" alt="Screenshot 2025-03-03 at 1 39 39 PM"
src="https://github.com/user-attachments/assets/ad7ada01-f35d-4fcf-a20c-deb42b55b34e"
/> | <img width="1297" alt="Screenshot 2025-03-03 at 3 38 21 PM"
src="https://github.com/user-attachments/assets/9b771126-30a0-479b-8c29-f5f572936f56"
/> |
There are a few known issues that should be addressed as follow-ups:
- The horizontal scrolling within a table is linked with the scrolling
of the parent container (e.g., the Assistant 2 thread)
- Cells are currently cut off entirely when they are too wide, would be
nice to truncate them with an ellipsis
Release Notes:
- N/A
Drop previous reparse task, if a new one is spawned.
Release Notes:
- N/A
Kirill Bulatov
created
dc3158c
git: Don't consider $HOME as containing git repository unless it's opened directly (#25948)
Click to expand commit body
When a worktree is created, we walk up the ancestors of the root path
trying to find a git repository. In particular, if your `$HOME` is a git
repository and you open some subdirectory of `$HOME` that's *not* a git
repository, we end up scanning `$HOME` and everything under it looking
for changed and untracked files, which is often pretty slow. Consistency
here is not very useful and leads to a bad experience.
This PR adds a special case to not consider `$HOME` as a containing git
repository, unless you ask for it by doing the equivalent of `zed ~`.
Release Notes:
- Changed the behavior of git features to not treat `$HOME` as a git
repository unless opened directly
Cole Miller
created
9e2b7bc
Fix missing hunks in project diff after revert (#25906)
Click to expand commit body
Release Notes:
- N/A
Cole Miller
created
b774a4b
Add some logging to debug missing parent git repositories (#25943)
Click to expand commit body
We've had some issues reported with git repositories not getting
detected when they're a strict parent of the worktree root. Add a bit
more logging to understand what's going on here.
Release Notes:
- N/A
Cole Miller
created
16ab870
git_ui: Prevent button overflow due to long names (#25940)
Click to expand commit body
- Fix component preview widths for git panel
- Fix buttons getting pushed off the screen in git panel
Release Notes:
- N/A
---------
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Nate Butler
and
Mikayla Maki
created
b2add8c
assistant2: Restore tool uses when loading saved threads (#25942)
Click to expand commit body
This PR makes it so tool uses are restored when loading saved threads in
Assistant 2.
Release Notes:
- N/A
81ff6f7
assistant2: Persist threads using `serde_json` instead of `bincode` (#25938)
Click to expand commit body
This PR changes how we persist threads in Assistant2 to use `serde_json`
instead of `bincode` for the representation.
This makes the format more flexible to work with (and will allow for
using things like `#[serde(default)]`) if the schema changes over time.
Note: We have to bump the LMDB database version for this, so any threads
created before now will be gone.
Release Notes:
- N/A
Marshall Bowers
created
669082d
assistant2: Fix keyboard navigation issues when a picker is open (#25928)
Click to expand commit body
This fixes:
- Bug: Using "up" in model selector triggers assistant2::FocusUp not
menu::SelectPrev
- Bug: Pressing arrow up/down in the model selector opened in the inline
assistant doesn't work
- Bug: Dismissing the model selector with Esc is not working
- Bug: Dismissing context pickers with Esc no longer working
Release Notes:
- N/A
Bennet Bo Fenner
created
d5bc7b9
extension_cli: Make use of `scrollbar_thumb.background` a hard error (#25932)
Click to expand commit body
This PR updates the extension CLI to make the use of
`scrollbar_thumb.background` in a theme a hard error.
We're working to eradicate usage of this theme property, so this will
prevent new extensions from being published that use it.
Release Notes:
- N/A
Marshall Bowers
created
8bb2739
keymap: Update `Prev` to `Previous` follow-up (#25931)
Click to expand commit body
Follow-up for https://github.com/zed-industries/zed/pull/25909
Add three more action replacements:
```
1. "pane::ActivatePrevItem" -> "pane::ActivatePreviousItem"
2. "vim::MoveToPrev" -> "vim::MoveToPrevious"
3. "vim:MoveToPrevMatch" -> "vim:MoveToPreviousMatch"
```
Release Notes:
- N/A
smit
created
466be14
Revert "Use multi-line regex for '\s'" (#25926)
Click to expand commit body
Reverts zed-industries/zed#19241
Closes: https://github.com/zed-industries/zed/issues/25901
Although `\s` contains `\n` it is widely used in non-multiline regexes (unlike `\n`).
Closes https://github.com/zed-industries/zed/issues/25865
Closes https://github.com/zed-industries/zed/pull/25915
In the issue, Zed had caused `.git/lfs/tmp/466102258`-like files to
appear in the directory, which lead to background FS event listener to
handle this as an update, incrementing snapshot's `scan_id`, which lead
to git status rescan, which caused another increment to `status_scan_id`
— incrementing either of the IDs causes the related repo data to be
considered "changed:
https://github.com/zed-industries/zed/blob/41b45eaba798a56e596857fa497c862050788bc7/crates/worktree/src/worktree.rs#L1590-L1605
hence propagating events to the other parts of the system (e.g. git
blame, which was also active in the issue's case)
```
[2025-03-01T20:01:08+01:00 DEBUG worktree] ignoring event ".git/lfs/tmp/466102258" within unloaded directory
[2025-03-01T20:01:08+01:00 DEBUG worktree] received fs events []
[2025-03-01T20:01:08+01:00 DEBUG worktree] reloading repositories: ["/Users/alex/dev/monorepo/.git"]
[2025-03-01T20:01:08+01:00 DEBUG editor::git::blame] Status of git repositories updated. Regenerating blame data...
[2025-03-01T20:01:08+01:00 DEBUG editor::git::blame] Status of git repositories updated. Regenerating blame data...
[2025-03-01T20:01:08+01:00 DEBUG editor::git::blame] Status of git repositories updated. Regenerating blame data...
```
Due to repo update events sent, another `.git/lfs/tmp/` entry is
created, things start over...
The PR fixes this by ignoring any `.git/lfs/` directory-related FS
events, as needed for the current git status update heuristics.
https://github.com/zed-industries/zed/pull/25915 tried to follow further
and `scan_id` and `status_scan_id` but we do not store all git state in
memory, e.g. head
https://github.com/zed-industries/zed/blob/e0060b92cc862c4d926652e1a01f0991ccb3a805/crates/editor/src/editor_tests.rs#L13686
as
[tests](https://github.com/zed-industries/zed/actions/runs/13631960559/job/38101504549?pr=25915)
show.
Release Notes:
- Improved `.git` scan heuristics