6550a96e152b292364347ca08964c54d43766b39
Longer write-up, sorry if this got a bit too long. This PR removes a small gap between the editor gutter and the horizontal scrollbar, if present, by stretching the scrollbar track the entire witdth of the editor. https://github.com/user-attachments/assets/d5c18b03-d1ff-4d48-a3da-5d0fb80ee967 This gap which can be seen in the bottom left of the video can cause bugs when interacting with it using the cursor, as accidentally clicking on it would trigger a vertical scroll instead of dragging the horizontal scroll. Also for cases where themes provide a non-transparent scrollbar track background, which can be seen in the video, the small gap is visible whilst scrolling horizontally. This gap is present because the horizontal editor scrollbar is layouted based upon the `content_origin`, which offsets the whole layout by the horizontal gutter margin to the right. However, the scrollbar should be layouted based upon the editor text bounds to be properly painted over the entire editor text hitbox. Here are some comparison images with `scrollbar.track.background` and `gutter.background` set to red for visibility. | | Current `main` | With this change | | - | - | - | | Default position / Fully scrolled to the left | <img width="842" alt="left_main" src="https://github.com/user-attachments/assets/8b053fc8-5271-4b58-8404-dcabf49bf702" /> | <img width="842" alt="left_fix" src="https://github.com/user-attachments/assets/459df723-05d5-4813-a6a4-038f7d662495" /> | | Scrolled to the right | <img width="216" alt="scroll_main" src="https://github.com/user-attachments/assets/9c1fcc0d-fbb4-49af-9645-f258f5a7217b" /> | <img width="216" alt="scroll_fix" src="https://github.com/user-attachments/assets/8dd2e585-7802-415b-a05a-fb40a882323e" /> | --- #### Small downsight of this approach Currently, the scrollbar thumb aligns with the indent guides if the editor is fully scrolled to the left and the track background is transparent. This is because the indent guides are layouted according to the content margin. With this change, however, the scrollbar thumb will shift a few pixels to the left and will overlap the indent guides if present. | Current `main` | With this change | | - | - | | <img width="295" alt="cur_indent" src="https://github.com/user-attachments/assets/92753951-6f35-4c39-94eb-21c445f8d2f5" /> | <img width="381" alt="fix_indent" src="https://github.com/user-attachments/assets/899d945c-49f8-4117-bc48-52501d55cc33" /> | To circumvent this, the scrollbar thumb could be layouted with a small offset so that the thumb aligns properly with the indent guides whilst the scrollbar track spans the whole editor width. This would lead to some questions on how to account for the gap during layouting and dragging of the thumb though, but might work for a gap that small. Happy to implement this fix, should that be preferred 😄 (VSCode does not have the indent guide issue, as they do not layout the text in the editor with any offset unlike Zed does) Release Notes: - Removed a small gap between the editor gutter and horizontal scrollbar.
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS and Linux you can download Zed directly or install Zed via your local package manager.
Other platforms are not yet available:
- Windows (tracking issue)
- 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.
Description
GPUI – Community Edition maintained by Oak Team
https://gpui-ce.github.io/
257 MiB
Languages
Rust
95.5%
WGSL
1.2%
Metal
1.1%
HLSL
1.1%
Python
0.7%
Other
0.3%