Always update twice assuming we may need to measure

This prepares the ground for measuring absoltue cursor positions.
This commit is contained in:
Nathan Sobo
2017-02-24 11:00:38 -07:00
committed by Antonio Scandurra
parent 583c2c537d
commit 43386b0483

View File

@@ -54,15 +54,16 @@ class TextEditorComponent {
if (this.staleMeasurements.editorDimensions) this.measureEditorDimensions()
const longestLine = this.getLongestScreenLine()
let measureLongestLine = false
if (longestLine !== this.previousLongestLine) {
this.longestLineToMeasure = longestLine
etch.updateSync(this)
this.measureLongestLineWidth()
this.previousLongestLine = longestLine
etch.updateSync(this)
} else {
etch.updateSync(this)
measureLongestLine = true
}
etch.updateSync(this)
if (measureLongestLine) this.measureLongestLineWidth()
etch.updateSync(this)
}
render () {