Avoid full decorations query when decorations are added

This commit is contained in:
Nathan Sobo
2015-02-02 23:28:57 -07:00
parent b78522d8e6
commit 2dc29a60ef

View File

@@ -587,12 +587,10 @@ class TextEditorPresenter
didAddDecoration: (decoration) ->
@observeDecoration(decoration)
if decoration.isType('line')
@updateDecorations()
@updateLinesState()
if decoration.isType('line-number')
@updateDecorations()
@updateLineNumbersState()
if decoration.isType('line') or decoration.isType('line-number')
@addToLineDecorationCaches(decoration, decoration.getMarker().getScreenRange())
@updateLinesState() if decoration.isType('line')
@updateLineNumbersState() if decoration.isType('line-number')
else if decoration.isType('highlight')
@updateHighlightState(decoration)
else if decoration.isType('overlay')