mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Use raw DOM api to insert lines to avoid slow jQuery.clean
This commit is contained in:
@@ -202,15 +202,16 @@ class Editor extends View
|
||||
elementsToReplace = @lineCache[startRow...endRow]
|
||||
@lineCache[startRow...endRow] = lineElements?.toArray() or []
|
||||
|
||||
lines = @lines[0]
|
||||
if lineElements
|
||||
if elementsToReplace.length
|
||||
$(elementsToReplace).replaceWith(lineElements)
|
||||
else if elementToInsertBefore
|
||||
$(elementToInsertBefore).before(lineElements)
|
||||
if elementToInsertBefore
|
||||
lineElements.each ->
|
||||
lines.insertBefore(this, elementToInsertBefore)
|
||||
else
|
||||
@lines.append(lineElements)
|
||||
else
|
||||
removeElements.remove()
|
||||
lineElements.each ->
|
||||
lines.appendChild(this)
|
||||
|
||||
$(elementsToReplace).remove()
|
||||
|
||||
getLineElement: (row) ->
|
||||
@lineCache[row]
|
||||
|
||||
Reference in New Issue
Block a user