Zed Improved. Aiming to improve upon Zed and make a truly delightful code editor. https://zed.dev
Find a file
Finn Evers 06794f35bc
assistant: Do not create new context on load (#29480)
Closes https://github.com/zed-industries/zed/issues/27673
Closes https://github.com/zed-industries/zed/issues/29344
Closes #29863 

This PR fixes an issue where Zed was showing no language and `4:1` as a
line/column value on startup, as described in the linked issues. You can
actually see in the first issue that the user also experiences the same
issue as described in the second one, as his line/column value is
noticably also `4:1`.


https://github.com/user-attachments/assets/bb60e387-f4b8-4e05-80b3-4dadf1a01262

This issue arises because on assistant panel load, a new context is
created and its editor focused. However, the editor is not visible
despite having focus. The content for the editor for a new context is
`\n\n\n` and the cursor is inserted directly after that - this is where
the line:column position `4:1` comes from. For the assistant panel
editor, the language is intentionally hidden, this is why the language
is not shown on workspace load.
The issue is only present for as long as the user does not focus and
edit another editor, then that instance is focused and everything starts
to work properly again.

As this issue only arises with the old assistant panel, some staff
members were unable to reproduce in the linked issues. Once you set
`export ZED_DISABLE_STAFF=1` in your environment, you should also be
able to reproduce this issue consistently.

--- 

This PR fixes the issue by not creating a new context on assistant panel
load. This should not cause any regressions; every other code path I
checked creates a new context if no context is yet present.
Additionally, this also seems somewhat more reasonable, as users which
have the assistant panel disabled will never need a new context anyway,
so no context should be created.

In the following video, you can see this fixes the issue when the
assistant panel was not open the last time Zed was opened. If the panel
was open before Zed was closed, we will still properly focus the panel
and then the `4:1` will show again, which in that case is correct. The
assistant panel editor is focused and the missing language as well as
the line number then match what the user sees, experiences and expects.


https://github.com/user-attachments/assets/224a786b-52c7-4212-bccb-dff6d9db62c3


Release Notes:

- Fixed an issue where Zed would show no language and an incorrect
line/column value on startup.

Co-authored-by: Peter Tripp <peter@zed.dev>
2025-05-06 11:38:08 +02:00
.cargo nix: Clean up build (#27881) 2025-04-01 22:35:15 +00:00
.cloudflare docs: Document context servers (#21170) 2024-11-25 11:05:14 -05:00
.config workspace-hack: remove openssl from remote_server (#27990) 2025-04-03 00:49:07 +00:00
.github Make the default repetitions be 8, and concurrency 4 (#29576) 2025-04-30 15:21:19 -04:00
.zed zed: Reinstate default file_scan_exclusions in Zed repo project settings (#29690) 2025-04-30 17:50:56 +00:00
assets title_bar: Add icon for project branch trigger button (#29494) 2025-05-06 08:38:24 +00:00
crates assistant: Do not create new context on load (#29480) 2025-05-06 11:38:08 +02:00
docs docs: Fix a broken link to the PyRight Settings section (#29283) 2025-05-05 18:02:53 -04:00
extensions Run additional checks from script/clippy if local (#29768) 2025-05-02 01:26:12 +00:00
legal legal: Terms of Use (2025-02-13) (#24803) 2025-02-13 09:41:43 -05:00
nix nix: Add libX11 dependency for X11 support (#28938) 2025-04-17 12:58:45 -07:00
script Run additional checks from script/clippy if local (#29768) 2025-05-02 01:26:12 +00:00
tooling Get terminal tool working in evals (#29831) 2025-05-05 08:07:43 -04:00
.clinerules Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
.cursorrules Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
.git-blame-ignore-revs Add additional git-blame-ignore-revs (#27189) 2025-03-20 09:17:56 -04:00
.gitattributes Prevent GitHub from displaying comments within JSON files as errors (#7043) 2024-01-29 23:11:25 -05:00
.gitignore chore: Update .gitignore (#29466) 2025-04-26 10:00:36 +00:00
.mailmap Add myself (Ben Kunkle) and Smit to the mailmap (#25590) 2025-02-25 19:55:39 +00:00
.rules rules: How to run clippy (#29247) 2025-04-25 13:25:39 -03:00
.windsurfrules Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
Cargo.lock component: Component crate cleanup (#29967) 2025-05-06 03:41:52 +00:00
Cargo.toml agent: Switch to new web search provider (#29951) 2025-05-06 00:47:11 +02:00
CLAUDE.md Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
clippy.toml Restructure agent context (#29233) 2025-04-24 21:29:33 +00:00
CODE_OF_CONDUCT.md Remove community content from docs and point to zed.dev (#19895) 2024-10-29 09:44:58 -04:00
compose.yml Add Postgrest to Docker Compose (#16498) 2024-08-19 20:50:45 -04:00
CONTRIBUTING.md Allow icon themes to provide their own file associations (#24926) 2025-02-15 00:35:13 +00:00
Cross.toml Add remote server cross compilation (#19136) 2024-10-12 23:23:56 -07:00
debug.plist WIP 2023-12-14 09:25:14 -07:00
default.nix Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
docker-compose.sql collab: Setup database for LLM service (#15882) 2024-08-06 17:18:08 -04:00
Dockerfile-collab chore: Bump Rust version to 1.86 (#28021) 2025-04-03 23:32:50 +02:00
Dockerfile-collab.dockerignore ci: Move collab to Dockerfile-collab (#18515) 2024-09-30 16:14:26 -04:00
Dockerfile-cross Add remote server cross compilation (#19136) 2024-10-12 23:23:56 -07:00
Dockerfile-cross.dockerignore Add remote server cross compilation (#19136) 2024-10-12 23:23:56 -07:00
Dockerfile-distros Support More Linux (#18480) 2024-09-30 17:46:21 -04:00
Dockerfile-distros.dockerignore Support More Linux (#18480) 2024-09-30 17:46:21 -04:00
flake.lock nix: Bump rust-overlay for Rust 1.86 (#28181) 2025-04-14 01:14:54 -07:00
flake.nix nix: Separate debug output (#27871) 2025-04-01 14:19:10 -07:00
LICENSE-AGPL Update license year (#24191) 2025-02-04 09:02:59 -05:00
LICENSE-APACHE Update license year (#24191) 2025-02-04 09:02:59 -05:00
LICENSE-GPL Licenses: change license fields in Cargo.toml to AGPL-3.0-or-later. (#5535) 2024-01-27 13:51:16 +01:00
livekit.yaml Add LiveKit server to Docker Compose (#7907) 2024-02-16 10:49:48 -05:00
Procfile Refactor: Restructure collab main function to prepare for new subcommand: serve llm (#15824) 2024-08-05 12:07:38 -07:00
Procfile.postgrest Fix llm queries (#16006) 2024-08-08 17:21:38 -07:00
README.md Format READMEs (#17454) 2024-09-05 15:39:16 -04:00
renovate.json renovate: Require dependency dashboard approval for updates (#29065) 2025-04-18 18:44:30 +00:00
rust-toolchain.toml chore: Bump Rust version to 1.86 (#28021) 2025-04-03 23:32:50 +02:00
shell.nix Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
typos.toml Fix typo in typos.toml (#29770) 2025-05-02 02:01:07 +00:00

Zed

CI

Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.


Installation

Packaging status

On macOS and Linux you can download Zed directly or install Zed via your local package manager.

Other platforms are not yet available:

Developing Zed

Contributing

See CONTRIBUTING.md for ways you can contribute to Zed.

Also... we're hiring! Check out our jobs page for open roles.

Licensing

License information for third party dependencies must be correctly provided for CI to pass.

We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:

  • Is it showing a no license specified error for a crate you've created? If so, add publish = false under [package] in your crate's Cargo.toml.
  • Is the error failed to satisfy license requirements for a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to the accepted array in script/licenses/zed-licenses.toml.
  • Is cargo-about unable to find the license for a dependency? If so, add a clarification field at the end of script/licenses/zed-licenses.toml, as specified in the cargo-about book.