Add .decorationClasses to line state on initial render

This commit is contained in:
Nathan Sobo
2015-01-21 10:47:32 -07:00
parent bf9428aa19
commit 06ef0792ce
2 changed files with 20 additions and 1 deletions

View File

@@ -66,6 +66,12 @@ class TextEditorPresenter
lineState.top = row * @getLineHeight()
buildLineState: (row, line) ->
decorationClasses = null
for markerId, decorations of @model.decorationsForScreenRowRange(row, row) when @model.getMarker(markerId).isValid()
for decoration in decorations when decoration.isType('line')
decorationClasses ?= []
decorationClasses.push(decoration.getProperties().class)
@state.content.lines[line.id] =
screenRow: row
text: line.text
@@ -75,6 +81,7 @@ class TextEditorPresenter
tabLength: line.tabLength
fold: line.fold
top: row * @getLineHeight()
decorationClasses: decorationClasses
getStartRow: ->
startRow = Math.floor(@getScrollTop() / @getLineHeight()) - @lineOverdrawMargin