From 43386b048346911cb2d16cec7aa0b05453c717af Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 24 Feb 2017 11:00:38 -0700 Subject: [PATCH] Always update twice assuming we may need to measure This prepares the ground for measuring absoltue cursor positions. --- src/text-editor-component.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 89c09277d..2b8b19db7 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -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 () {