mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Base textNodeLength on textNode.textContent.length
This is how we were computing the length previously. Not sure what the difference is but I want to keep it the same.
This commit is contained in:
@@ -346,15 +346,15 @@ class LinesTileComponent
|
||||
rangeForMeasurement ?= document.createRange()
|
||||
iterator = document.createNodeIterator(lineNode, NodeFilter.SHOW_TEXT, AcceptFilter)
|
||||
textNode = iterator.nextNode()
|
||||
textNodeLength = textNode.length
|
||||
textNodeLength = textNode.textContent.length
|
||||
textNodeIndex = 0
|
||||
nextTextNodeIndex = textNode.textContent.length
|
||||
nextTextNodeIndex = textNodeLength
|
||||
|
||||
while nextTextNodeIndex <= charIndex
|
||||
textNode = iterator.nextNode()
|
||||
textNodeLength = textNode.length
|
||||
textNodeLength = textNode.textContent.length
|
||||
textNodeIndex = nextTextNodeIndex
|
||||
nextTextNodeIndex = textNodeIndex + textNode.textContent.length
|
||||
nextTextNodeIndex = textNodeIndex + textNodeLength
|
||||
|
||||
i = charIndex - textNodeIndex
|
||||
rangeForMeasurement.setStart(textNode, i)
|
||||
|
||||
Reference in New Issue
Block a user