Constrain line/line number decoration update to rendered rows

This commit is contained in:
Nathan Sobo
2017-03-06 20:53:18 -07:00
committed by Antonio Scandurra
parent eacf0d8f64
commit 3101e28459

View File

@@ -449,8 +449,11 @@ class TextEditorComponent {
}
}
startRow = Math.max(startRow, this.getRenderedStartRow())
endRow = Math.min(endRow, this.getRenderedEndRow() - 1)
for (let row = startRow; row <= endRow; row++) {
if (omitLastRow && row === endRow) break
if (omitLastRow && row === screenRange.end.row) break
const currentClassName = decorationsByRow.get(row)
const newClassName = currentClassName ? currentClassName + ' ' + decoration.class : decoration.class
decorationsByRow.set(row, newClassName)