Fix exception in screenPositionForPixelPosition when content updates are pending

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Max Brunsfeld
2017-07-18 14:31:47 -07:00
committed by Nathan Sobo
parent f62e0bceef
commit 48abb16edb
2 changed files with 12 additions and 3 deletions

View File

@@ -251,20 +251,17 @@ class TextEditorComponent {
this.measureBlockDecorations()
this.measuredContent = false
this.updateSyncBeforeMeasuringContent()
if (useScheduler === true) {
const scheduler = etch.getScheduler()
scheduler.readDocument(() => {
this.measureContentDuringUpdateSync()
this.measuredContent = true
scheduler.updateDocument(() => {
this.updateSyncAfterMeasuringContent()
})
})
} else {
this.measureContentDuringUpdateSync()
this.measuredContent = true
this.updateSyncAfterMeasuringContent()
}
}
@@ -341,6 +338,7 @@ class TextEditorComponent {
}
updateSyncBeforeMeasuringContent () {
this.measuredContent = false
this.derivedDimensionsCache = {}
this.updateModelSoftWrapColumn()
if (this.pendingAutoscroll) {
@@ -384,6 +382,8 @@ class TextEditorComponent {
}
this.pendingAutoscroll = null
}
this.measuredContent = true
}
updateSyncAfterMeasuringContent () {