Maintain a map of line components instead of line nodes and text nodes

Other than simplifying the code, this will help us understand whether
https://github.com/atom/atom/issues/15263 might be related to a node
reuse issue.

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Antonio Scandurra
2017-08-23 14:52:50 +02:00
committed by Nathan Sobo
parent eaf358bd3e
commit 74ae169fcc
2 changed files with 37 additions and 42 deletions

View File

@@ -4225,12 +4225,12 @@ function lineNumberNodeForScreenRow (component, row) {
function lineNodeForScreenRow (component, row) {
const renderedScreenLine = component.renderedScreenLineForRow(row)
return component.lineNodesByScreenLineId.get(renderedScreenLine.id)
return component.lineComponentsByScreenLineId.get(renderedScreenLine.id).element
}
function textNodesForScreenRow (component, row) {
const screenLine = component.renderedScreenLineForRow(row)
return component.textNodesByScreenLineId.get(screenLine.id)
return component.lineComponentsByScreenLineId.get(screenLine.id).textNodes
}
function setScrollTop (component, scrollTop) {