Closes #4526 Adds basic bookmark functionality to the editor, allowing users to mark lines and later navigate between them. ### What's new **Toggling bookmarks** Users can toggle a bookmark on the current line(s) via the `editor: toggle bookmark` action. A bookmark icon appears in the gutter for each bookmarked line. **Navigation** Two new actions, `editor: go to next bookmark` and `editor: go to previous bookmark`, navigate between bookmarks in the current buffer, wrapping around at the ends of the buffer. **Viewing all bookmarks** `editor: view bookmarks` opens all bookmarks across the project in a multibuffer, similar to how references and diagnostics are surfaced. **Clearing bookmarks** `workspace: clear bookmarks` removes all bookmarks in the current project. **Persistence** Bookmarks are persisted to the workspace database and restored when the workspace is reopened. They are stored as `(path, row)` pairs and resolved back to text anchors. Out of range or unresolvable bookmarks are skipped with a logged warning. **Gutter rendering** Bookmark icons are rendered in the gutter using the existing gutter button layout system, consistent with breakpoints. They are suppressed on lines that already show a breakpoint or phantom breakpoint indicator. A new `gutter.bookmarks` setting (defaulting to `true`) controls their visibility. ### What's left - [x] Lazily load buffers that have bookmarks - [x] Clean up test boilerplate - [ ] Assign default keybindings - [ ] Compare line of saved bookmarks with current buffer (gray out the "stale" bookmarks) ### What's next (and nice to haves) - [ ] Resilience against external edits - [ ] Save column position with the bookmark - [ ] Bookmarks attached to syntactic structures? - [ ] Labeled bookmarks? --- Release Notes: - Added bookmarks: toggle bookmarks on lines with `editor: toggle bookmark`, navigate with `editor: go to next bookmark` / `editor: go to previous bookmark`, view all bookmarks with `editor: view bookmarks`, and clear with `workspace: clear bookmarks`. Bookmarks are shown in the gutter and persisted across sessions. --------- Co-authored-by: Yara <git@yara.blue>
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 issue)
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 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.