mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Make comment more succinct
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
committed by
Nathan Sobo
parent
ec14125ecb
commit
f640e9339d
@@ -2890,16 +2890,8 @@ class TextEditorComponent {
|
||||
const renderedEndRow = renderedStartRow + (this.getVisibleTileCount() * this.getRowsPerTile())
|
||||
this.props.model.displayLayer.populateSpatialIndexIfNeeded(Infinity, renderedEndRow)
|
||||
|
||||
// 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, 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.
|
||||
// If the approximate screen line count changes, previously-cached derived
|
||||
// dimensions could now be out of date.
|
||||
if (model.getApproximateScreenLineCount() !== previousScreenLineCount) {
|
||||
this.derivedDimensionsCache = {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user