mirror of
https://github.com/atom/atom.git
synced 2026-01-15 01:48:15 -05:00
Limit line decoration update to visible row range
Previously, if we had selections exceeding the visible range we would do a bunch of unnecessary work and rendering would become very slow.
This commit is contained in:
@@ -1141,7 +1141,9 @@ class TextEditorPresenter
|
||||
@lineNumberDecorationsByScreenRow[screenRow] ?= {}
|
||||
@lineNumberDecorationsByScreenRow[screenRow][decorationId] = properties
|
||||
else
|
||||
for row in [screenRange.start.row..screenRange.end.row] by 1
|
||||
startRow = Math.max(screenRange.start.row, @getStartTileRow())
|
||||
endRow = Math.min(screenRange.end.row, @getEndTileRow() + @tileSize)
|
||||
for row in [startRow..endRow] by 1
|
||||
continue if properties.onlyHead and row isnt headScreenPosition.row
|
||||
continue if omitLastRow and row is screenRange.end.row
|
||||
|
||||
|
||||
Reference in New Issue
Block a user