-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Allowing to define variable line heights #233110
Open
aiday-mar
wants to merge
68
commits into
main
Choose a base branch
from
line-height
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Decorations may affect line wrapping. For example, they make make the text bold, or increase or decrease font size. This wasn’t originally taken into account to calculate the the break offsets.
auto-merge was automatically disabled
January 10, 2025 09:34
Pull request was converted to draft
I have made a testing pass on the work in this PR which has revealed certain bugs which I need to address. The bugs and the findings are written in the PR summary at the top. |
This reverts commit 1a44ac3.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #147067
Test pass 1:
Verify the following cases:
Show Editor Context Menu
makes context menu appear at the correct location🐛 Because different line heights, the cursor is placed behind the sticky widget in certain cases. In our reveal logic we add as a padding top maxStickyLines * lineHeight but in our case line height can be variable.
To discuss
Diffs are not correctly aligned in a diff editor on either side when special line heghts are set ever since we have made line height define per editor and not per text model. We can see it in the following case:
In the right editor the line heights are larger than the in left editor hence the diffs are no longer aligned. To mitigate this we have several options:
As well as this, since the line heights are set per editor, from the diff editor, when you click on
Toggle Collpased Unchaned Regions
, this opens a diff editor where the line heights are the default ones. This is inconsistent user experience.Issue discovered that should be fixed separately:
When revealing a line for example by using the cursor up comman, the cursor can end up below the sticky scroll widget which has the modified line height. This happens because we set as the padding:
maxNumberOfStickyLines * lineHeight
. In our case however lineHeight can be larger than the default line height, and so the padding is not enough, hence the cursor appears below the sticky widget. To fix this, I will have to redefine how view lines interact with the sticky scroll widget.