Skip to content

Only change the line height of the view line - #258454

Open
Remco Haszing (remcohaszing) wants to merge 1 commit into
microsoft:mainfrom
remcohaszing:line-height-range
Open

Remco Haszing (remcohaszing) wants to merge 1 commit into
microsoft:mainfrom
remcohaszing:line-height-range

Conversation

@remcohaszing

@remcohaszing Remco Haszing (remcohaszing) commented Jul 29, 2025 •

Copy link
Copy Markdown
Contributor

Previously, if a decoration specified a custom line height, this affected all viewlines that are covered by model line. Now the line height is only applied to the view lines that render the decoration.

It is still possible to change the line height of an entire view line by setting the decoration option isWholeLine.

image

Closes #249967
Closes #295179

cc Aiday Marlen Kyzy (@aiday-mar)

@remcohaszing

Copy link
Copy Markdown
Contributor Author

Apparently this works, but the line heights are not updated if the lines are affected by changes to line wrapping. I’m feeling a bit stuck on this and would really appreciate some help or feedback.

@aiday-mar

Copy link
Copy Markdown
Collaborator

Hi Remco Haszing (@remcohaszing) thank you for this PR. I am not sure we should apply the line height only to the view line because as you mentioned if line wrapping is turned on, and you change the size of the window, then the decorations will change position and you would have to change the size of the line heights. This means the line heights would dynamically change as you resize the screen. This adds a whole layer of complexity to the work. Could we start off by opening an issue about this, and discussing it within the issue, how important of an issue this is, if its urgent, before writing this code and merging it?

Previously, if a decoration specified a custom line height, this
affected all viewlines that are covered by model line. Now the line
height is only applied to the view lines that render the decoration.

It is still possible to change the line height of an entire view line by
setting the decoration option `isWholeLine`.
@remcohaszing

Copy link
Copy Markdown
Contributor Author

I had another look today after having taken a break from it and managed to fix the remaining issues.

The reason I’m diving straight into the code, is because my client needs this. From their perspective this is a regression compared to my initial support for variable line heights. They currently depend on a fork, but ideally they won’t have to in the future.

Note that it’s still possible to apply the special line height to the entire unwrapped line by using isWholeLine.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom line heights should only affect the view line Apply decoration lineHeight on all affected lines after line wrapping

3 participants