Hide off-screen lines when we render them for measurement

This commit is contained in:
Nathan Sobo
2017-08-16 10:00:57 -06:00
parent da2c3fb56b
commit c398fe66c9
2 changed files with 23 additions and 1 deletions

View File

@@ -618,6 +618,7 @@ class TextEditorComponent {
if (screenRow < startRow || screenRow >= endRow) {
children.push($(LineComponent, {
key: 'extra-' + screenLine.id,
hidden: true,
screenLine,
screenRow,
displayLayer: this.props.model.displayLayer,
@@ -3863,11 +3864,16 @@ class LineComponent {
}
appendContents () {
const {displayLayer, nodePool, screenLine, textDecorations, textNodesByScreenLineId} = this.props
const {displayLayer, nodePool, hidden, screenLine, textDecorations, textNodesByScreenLineId} = this.props
const textNodes = []
textNodesByScreenLineId.set(screenLine.id, textNodes)
if (hidden) {
this.element.style.position = 'absolute'
this.element.style.visibility = 'hidden'
}
const {lineText, tags} = screenLine
let openScopeNode = nodePool.getElement('SPAN', null, null)
this.element.appendChild(openScopeNode)