Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Find a file
Andrew Lygin 9d9bce08a7
Fix scroll thumb (#10667)
Editor scrollbar has several issues that show up on large files:

- The thumb scrolls beyond the window.
- When dragged, the thumb goes out of sync with the mouse pointer.
- When the scrollbar trunk is clicked, the thumb jumps incorrectly.


https://github.com/zed-industries/zed/assets/2101250/320dba59-a526-4e68-99b3-1186271ba839

The reason is that the scrollbar now has two modes:
1. The "basic mode" for small files, when the thumb height correctly
represents the visible area, i.e. the top of the thumb matches the top
visible row (let's call it top-to-top sync), and the bottom of the thumb
matches the bottom visible row.
2. The "extended mode" for large files, when thumb becomes too small and
we have to impose minimal height to it. In this mode we have a vertical
offset of the first row position inside the scrollbar, we try to
position the thumb center-to-center with the editor.

...and the second mode is not implemented correctly. Also, mouse event
handlers ignore it. It is possible to fix this implementation, but I'm
not sure if it worth doing because it a) leads to some confusing cases
(for instance, in the extended mode the first row marker is not at the
top of the scrollbar), and b) differs from what all other editors do.

Here's a previous mentioning of this problem:
https://github.com/zed-industries/zed/pull/9080#pullrequestreview-1927465293

This PR changes the "extended mode", making it synchronize the thumb
top-to-top with the editor. It solves all the mentioned problems and
makes the scroll thumb work the same whay as in other editors.

But if you want to stick to the idea of the center-to-center sync for
large files, I can do that too.

Release Notes:

- Fixed scroll thumb behaviour.

Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.

- N/A
2024-04-19 23:18:37 +03:00
.cargo Enable tokio-console (#8897) 2024-03-05 10:56:14 -07:00
.config tests: Test 'db' package sequentially (#2654) 2023-06-28 15:00:43 +02:00
.github Have the CI server draft the release notes (#10700) 2024-04-17 15:51:45 -06:00
.zed Rework task modal (#10341) 2024-04-11 02:02:04 +03:00
assets Add pull requests to git blame tooltip (#10784) 2024-04-19 18:54:20 +02:00
crates Fix scroll thumb (#10667) 2024-04-19 23:18:37 +03:00
docs docs: Install Windows 10/11 SDK with VS installation (#10550) 2024-04-18 14:42:20 -07:00
extensions Add bracket queries for HCL, Terraform (#10785) 2024-04-19 10:59:14 -07:00
script Remove empty script 2024-04-18 22:24:48 -04:00
tooling/xtask Windows: Enable clippy deny warnings (#9920) 2024-03-28 11:55:35 -04:00
.dockerignore Add serialized versions of themes (#6885) 2024-01-27 13:35:43 -05:00
.gitattributes Prevent GitHub from displaying comments within JSON files as errors (#7043) 2024-01-29 23:11:25 -05:00
.gitignore windows: Add file dialog using IFileOpenDialog (#8919) 2024-03-08 20:07:48 -08:00
.gitmodules WIP: start on live_kit_server 2022-10-17 09:59:16 +02:00
.mailmap Update .mailmap (#7871) 2024-02-15 18:35:43 -05:00
Cargo.lock Add pull requests to git blame tooltip (#10784) 2024-04-19 18:54:20 +02:00
Cargo.toml Properly pass nested script arguments for tasks (#10776) 2024-04-19 16:24:35 +03:00
CODE_OF_CONDUCT.md Add CODE_OF_CONDUCT.md (#4239) 2024-01-23 22:31:39 -05:00
CONTRIBUTING.md Remove stray word in CONTRIBUTING.md 2024-04-15 16:30:18 -04:00
debug.plist WIP 2023-12-14 09:25:14 -07:00
docker-compose.sql Add config files for running Postgres inside Docker Compose (#3637) 2023-12-13 17:25:07 -05:00
docker-compose.yml Add LiveKit server to Docker Compose (#7907) 2024-02-16 10:49:48 -05:00
Dockerfile Revert "Revert "chore: Bump Rust version to 1.77 (#9631)"" (#9672) 2024-03-22 11:17:16 +01:00
LICENSE-AGPL chore: Add crate licenses. (#4158) 2024-01-23 16:56:22 +01:00
LICENSE-APACHE chore: Add crate licenses. (#4158) 2024-01-23 16:56:22 +01: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 Revert change to tracing (#10578) 2024-04-15 14:00:56 -06:00
README.md Add links to jobs page in README and in app, under help menu (#10658) 2024-04-16 15:47:23 -07:00
rust-toolchain.toml Revert "Revert "chore: Bump Rust version to 1.77 (#9631)"" (#9672) 2024-03-22 11:17:16 +01:00
typos.toml Extract GLSL language support into an extension (#10433) 2024-04-11 13:52:10 -04:00

Zed

CI

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

Installation

You can download Zed today for macOS (v10.15+).

Support for additional platforms is on our roadmap:

For macOS users, you can also install Zed using Homebrew:

brew install --cask zed

Alternatively, to install the Preview release:

brew tap homebrew/cask-versions
brew install zed-preview

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.