Only clear linesToMeasure when we have actually measured

Previously, as soon as we decided to render linesToMeasure, we would
clear them out. However, if a second update interleaved with the update
that initially requested measurement, it could cause the requested lines
to not be present when the measurement phase from the first update
occurred. Now, any additional updates will only add to the set of lines
that need to be measured until the measurement phase actually happens.

Signed-off-by: Antonio Scandurra <as-cii@github.com>
This commit is contained in:
Nathan Sobo
2017-08-16 11:28:58 -06:00
committed by Antonio Scandurra
parent da2c3fb56b
commit c626836b2e
2 changed files with 21 additions and 1 deletions

View File

@@ -32,6 +32,10 @@ class TextEditorComponent {
etch.setScheduler(scheduler)
}
static getScheduler () {
return etch.getScheduler()
}
static didUpdateStyles () {
if (this.attachedComponents) {
this.attachedComponents.forEach((component) => {
@@ -389,6 +393,7 @@ class TextEditorComponent {
this.pendingAutoscroll = null
}
this.linesToMeasure.clear()
this.measuredContent = true
}
@@ -848,7 +853,6 @@ class TextEditorComponent {
this.extraRenderedScreenLines.set(row, screenLine)
}
})
this.linesToMeasure.clear()
}
queryLineNumbersToRender () {