From 2dc29a60efe9d91796b323a2cfa3f8463e40ae8f Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 2 Feb 2015 23:28:57 -0700 Subject: [PATCH] Avoid full decorations query when decorations are added --- src/text-editor-presenter.coffee | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index d57b52175..0ad4e5ec3 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -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')