404aaea39d403eb2c281448b035e7287c2b97f80
Closes #43354 Overview: In a diagnostic panel (and all Markdown derived panels, including function hint popovers and the like), the expected behavior is that when a user double clicks a word, the whole word is highlighted. If they double click and hold, then drag, the text selection proceeds word by word. There is similar behavior for triple click which goes line by line, and quadruple click which selects all text. Before this fix, the DiagnosticPopover allowed the user to click and drag, but double click and drag reverts to selecting text character by character. The same wrong behavior is shown for triple click (line). Quadruple click (all text) was not previously implemented in MarkdownElement. Quick example of wrong behavior, showing single click and drag, double click and drag, triple click and drag, then quadruple click (fails). https://github.com/user-attachments/assets/1184e64d-5467-4504-bbb6-404546eab90a Quick example showing the correct behavior fixed in this PR: https://github.com/user-attachments/assets/06bf5398-d6d6-496c-8fe9-705031207f05 Nota bene: I'm not a rust dev, so a lot of this relied on my C/C++ experience, cribbing from elsewhere in the repo, and help from Claude. If that's not ok for this project, I totally understand. Much of this was informed by editor.rs, using a similar pattern to SelectMode in there (see lines 450, and begin_selection and extend_selection). It didn't seem appropriate to import SelectMode from there (also Markdown range and Anchor range seemed different enough), nor did it seem appropriate to move SelectMode to markdown.rs. The tests are non-ui based, instead testing the relevant functions. Not sure if that's what's expected. Release Notes: - Double- and triple-click selection now correctly expands by word and by line within Markdown elements (diagnostics, agent panel, etc.).
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.
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
- Building Zed for macOS
- Building Zed for Linux
- Building Zed for Windows
- Running Collaboration Locally
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 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.
Languages
Rust
94.9%
JSON-with-Comments
2.7%
Python
0.8%
Inno Setup
0.3%
Tree-sitter Query
0.3%
Other
0.5%