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

Update soft wrap margins on gutter re-measurement #18087

Merged
merged 3 commits into from Sep 21, 2018

Conversation

Projects
None yet
2 participants
@smashwilson
Member

smashwilson commented Sep 21, 2018

Requirements for Contributing a Bug Fix

Identify the Bug

This fixes #18086. I've verified that this corrects the editor jank I observed both in my super-contrived isolated repro case and in the case where @Arcanemagus originally spotted it in atom/github#1512.

Description of the Change

Return true from TextEditorComponent::measureContentDuringUpdateSync() if the horizontal scrollbar has toggled its visibility or if gutter measurements have changed. This will cause updateSync() to restart the initial frame with the correct gutter measurements in place and calculate the correct soft-wrap column in time for the first render to complete.

Alternate Designs

I could have worked around this by manually triggering a TextEditorComponent update after the initial render has completed. That seems pretty hacky, though, and that PR already depends on features from 1.32, so I figured I might as well fix The Real Problem.

Possible Drawbacks

This could cause a more expensive initial render. We're already paying this price when a horizontal scrollbar is needed, though.

Verification Process

I've followed the repro steps from #18086 to make sure that the editor renders correctly on the first try. I've also used dev mode to verify that it fixes the way that this manifests in the GitHub package.

smashwilson added some commits Sep 21, 2018

@smashwilson smashwilson referenced this pull request Sep 21, 2018

Open

Render file patches with a decorated Editor #1512

88 of 92 tasks complete
@maxbrunsfeld

This comment has been minimized.

Show comment
Hide comment
@maxbrunsfeld

maxbrunsfeld Sep 21, 2018

Contributor

👏 Way to move fast and fix things.

Contributor

maxbrunsfeld commented Sep 21, 2018

👏 Way to move fast and fix things.

@smashwilson smashwilson merged commit d2c38ac into master Sep 21, 2018

3 checks passed

Atom Pull Requests #20180921.3 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@smashwilson smashwilson deleted the aw/gutter-measurement-update branch Sep 21, 2018

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