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

width of decoration is half sized on first render #142873

Closed
meganrogge opened this issue Feb 11, 2022 · 2 comments · Fixed by #143130
Closed

width of decoration is half sized on first render #142873

meganrogge opened this issue Feb 11, 2022 · 2 comments · Fixed by #143130
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration, command decorations, etc. verified Verification succeeded
Milestone

Comments

@meganrogge
Copy link
Contributor

meganrogge commented Feb 11, 2022

the last time onRender is called when a decoration is first added, its element has the wrong dimensions (about half sized). The next time refresh is called (if you type anything or scroll), it's fixed

the results in the left-margin, which factors in the element's dimensions, getting incorrectly calculated.

Recording 2022-02-11 at 13 34 03

@meganrogge meganrogge self-assigned this Feb 11, 2022
@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug terminal-command-decoration labels Feb 11, 2022
@meganrogge meganrogge added this to the February 2022 milestone Feb 11, 2022
@meganrogge meganrogge changed the title width of decoration's element is very small onRender for first decoration created width of decoration is half sized on first render Feb 11, 2022
@meganrogge
Copy link
Contributor Author

I think I know what's happening here - we listen to onRenderedBufferChange and onDimensionsChange and I believe the first (incorrect) dimensions are happening before onDimensionsChange has been fired. We should probably create the listener to onRenderedBufferChange the first time refresh is triggered via dimensions changing

meganrogge added a commit that referenced this issue Feb 15, 2022
@meganrogge
Copy link
Contributor Author

This was happening because the element's size was getting factored into the margin calculation. When it's first created, the size isn't quite right.

@meganrogge meganrogge linked a pull request Feb 15, 2022 that will close this issue
@mjbvz mjbvz added the verified Verification succeeded label Feb 25, 2022
@Tyriar Tyriar added the terminal-shell-integration Shell integration, command decorations, etc. label Feb 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration, command decorations, etc. verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants