From f640e9339d722dbd18180857359449a8bca5d88b Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 5 Oct 2017 18:54:26 +0200 Subject: [PATCH] Make comment more succinct Signed-off-by: Nathan Sobo --- src/text-editor-component.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 0a9d8c805..5667a733e 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -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 = {} }