Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent line spacing on large files #5371

Closed
JosephTLyons opened this issue Jun 14, 2022 · 1 comment · Fixed by #9176
Closed

Inconsistent line spacing on large files #5371

JosephTLyons opened this issue Jun 14, 2022 · 1 comment · Fixed by #9176
Assignees
Labels
defect [core label] editor Feedback for code editing, formatting, editor iterations, etc

Comments

@JosephTLyons
Copy link
Contributor

The space between lines starts to become inconsistent after so many lines:

image

long_file.txt

@osiewicz
Copy link
Contributor

osiewicz commented Mar 11, 2024

Heh, we're simply running into float precision limits when doing layout. You love to see it. =) Gonna open up a PR shortly.

osiewicz added a commit that referenced this issue Mar 11, 2024
We were seeing weird layouts with large files, where - starting with
some verylargelineindex - lines were rendered at weird y offsets. It
turned out that in some cases we're doing operations on Pixel values of
different magnitude, which then led to wrong results in calculations.
This commit addresses some of these problems, visible at glance when
working with large plaintext files. I *did not* dig into things like
inlay hints or diagnostics to see if they are subject to the same
potential precision loss.

Fixes #5371 

Release Notes:

- Fixed editor layout for large files, where the lines might have been
laid out with incorrect Y offset from the top.
@osiewicz osiewicz self-assigned this Mar 12, 2024
osiewicz added a commit that referenced this issue Mar 23, 2024
This is another attempt to fix #5371 - this time around I've exposed internal scroll_anchor used to calculate scroll_position()' y coordinate. Now, row offset calculations are performed on integrals.

This makes layout precision dependant on the \# of rendered lines and not on the \# of lines as a whole.
osiewicz added a commit that referenced this issue Mar 23, 2024
This is another attempt to fix #5371 - this time around I've exposed internal scroll_anchor used to calculate scroll_position()' y coordinate. Now, row offset calculations are performed on integrals.

This makes layout precision dependant on the \# of rendered lines and not on the \# of lines as a whole.
osiewicz added a commit that referenced this issue Mar 25, 2024
This is another attempt to fix #5371 - this time around I've exposed internal scroll_anchor used to calculate scroll_position()' y coordinate. Now, row offset calculations are performed on integrals.

This makes layout precision dependant on the \# of rendered lines and not on the \# of lines as a whole.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] editor Feedback for code editing, formatting, editor iterations, etc
Projects
None yet
2 participants