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

Clear dimensions cache when approximate screen line count changes #15821

Merged
merged 8 commits into from Oct 5, 2017

Conversation

Projects
None yet
3 participants
@as-cii
Member

as-cii commented Oct 5, 2017

Fixes #15761

It is possible for the approximate screen line count to exceed the actual number of lines. This may happen if there are many soft-wraps and the display layer hasn't indexed the entire contents of the buffer.

In that circumstance, if a user attempts to scroll to a position that does not exist, we are unable to clip it correctly in setScrollTop because the line count approximation is also wrong. Therefore, after populating the spatial index in updateSyncBeforeMeasuringContent, we will make sure that the approximate screen line count did not change. If it did, we need to clear the derived dimensions cache (which contains, for example, the rendered row range) because it could contain incorrect values.

/cc: @nathansobo @Ben3eeE @ungb @rsese

jasmine.getEnv().defaultTimeoutInterval = originalTimeout
})
it('renders the visible rows correctly after randomly mutating the editor', async () => {

This comment has been minimized.

@nathansobo

nathansobo Oct 5, 2017

Contributor

Thanks so much for adding this. We probably should have had something like this all along. Lesson learned. We should never again release a system this complex without randomized testing it.

@nathansobo

nathansobo Oct 5, 2017

Contributor

Thanks so much for adding this. We probably should have had something like this all along. Lesson learned. We should never again release a system this complex without randomized testing it.

Show outdated Hide outdated src/text-editor-component.js Outdated

as-cii added some commits Oct 5, 2017

Make comment more succinct
Signed-off-by: Nathan Sobo <nathan@github.com>
⬆️ text-buffer
Signed-off-by: Nathan Sobo <nathan@github.com>
Exercise more features in the randomized test
Signed-off-by: Nathan Sobo <nathan@github.com>

@nathansobo nathansobo merged commit e457e6d into master Oct 5, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nathansobo nathansobo deleted the as-fix-overlapping-lines branch Oct 5, 2017

@maxbrunsfeld

This comment has been minimized.

Show comment
Hide comment
@maxbrunsfeld

maxbrunsfeld Oct 5, 2017

Contributor

👏

Contributor

maxbrunsfeld commented Oct 5, 2017

👏

nathansobo added a commit that referenced this pull request Oct 5, 2017

Merge pull request #15821 from atom/as-fix-overlapping-lines
Clear dimensions cache when approximate screen line count changes

nathansobo added a commit that referenced this pull request Oct 5, 2017

Merge pull request #15821 from atom/as-fix-overlapping-lines
Clear dimensions cache when approximate screen line count changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment