## Context The tab switcher was truncating file names at the same 24-character limit (`MAX_TAB_TITLE_LEN`) used by the narrow tab bar. This made files that share a long common prefix, like `test_cpp_file_long_name.h` and `test_cpp_file_long_name.cpp`, render identically, with both becoming `test_cpp_file_long_name.…`. The fix adds a `max_title_len: Option<usize>` field to `TabContentParams`. When `None` (the default, used by the tab bar), `Editor::tab_content` falls back to `MAX_TAB_TITLE_LEN` as before. The tab switcher passes `Some(usize::MAX)`, which skips truncation entirely and lets the UI container constrain the displayed text naturally. Closes #58461 ## How to Review - **`crates/workspace/src/item.rs`** : Adds `max_title_len: Option<usize>` to `TabContentParams`. Derives `Default` so `None` is the zero-cost default; two existing struct literals in `pane.rs` that couldn't use `..Default::default()` were updated to be explicit. - **`crates/editor/src/items.rs`** : In `Editor::tab_content`, both the title label and the description path now use `params.max_title_len.unwrap_or(MAX_TAB_TITLE_LEN)` instead of the hardcoded constant. - **`crates/workspace/src/pane.rs`** : Two `TabContentParams` struct literals updated to include `max_title_len: None`, preserving the existing 24-char tab bar behaviour. - **`crates/tab_switcher/src/tab_switcher.rs`** : Sets `max_title_len: Some(usize::MAX)` in `render_match`, opting the tab switcher out of truncation. Video of the manual test below : Used the same names of the files in the issue but also longer ones to showcase the behavior in different file lengths : [Screencast from 2026-06-04 00-08-02.webm](https://github.com/user-attachments/assets/5f388257-2f3d-494c-ab50-bf46496dbd38) I'm obviously open to discussing this further specially the new truncation behavior of the file with the longest name in the manual test. ## Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the UI/UX checklist - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed tab switcher truncating long file names, making files with a shared prefix indistinguishable
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking discussion)
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
Zed source code is licensed primarily under GPL-3.0-or-later, with Apache-2.0 components where marked.
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 specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor 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 theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.