diff --git a/src/editor-component.coffee b/src/editor-component.coffee index 48faf84a7..6eb5c319c 100644 --- a/src/editor-component.coffee +++ b/src/editor-component.coffee @@ -177,7 +177,9 @@ EditorComponent = React.createClass if @batchingUpdates @updateRequested = true else - @forceUpdate() + @willUpdate ?= setImmediate => + @forceUpdate() + @willUpdate = null getRenderedRowRange: -> {editor, lineOverdrawMargin} = @props @@ -526,10 +528,7 @@ EditorComponent = React.createClass @cursorsMoved = true onDecorationChanged: -> - return if @decorationChangedImmediate? - @decorationChangedImmediate = setImmediate => - @requestUpdate() - @decorationChangedImmediate = null + @requestUpdate() selectToMousePositionUntilMouseUp: (event) -> {editor} = @props diff --git a/src/editor.coffee b/src/editor.coffee index e2e314a4e..d5f4bfc21 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1126,7 +1126,8 @@ class Editor extends Model # # Returns nothing addDecorationToBufferRowRange: (startBufferRow, endBufferRow, decoration) -> - @displayBuffer.addDecorationToBufferRowRange(startBufferRow, endBufferRow, decoration) + @batchUpdates => + @displayBuffer.addDecorationToBufferRowRange(startBufferRow, endBufferRow, decoration) # Public: Removes a decoration from line numbers in a buffer row range # @@ -1136,7 +1137,8 @@ class Editor extends Model # # Returns nothing removeDecorationFromBufferRowRange: (startBufferRow, endBufferRow, decoration) -> - @displayBuffer.removeDecorationFromBufferRowRange(startBufferRow, endBufferRow, decoration) + @batchUpdates => + @displayBuffer.removeDecorationFromBufferRowRange(startBufferRow, endBufferRow, decoration) # Public: Adds a decoration that tracks a {Marker}. When the marker moves, # is invalidated, or is destroyed, the decoration will be updated to reflect the marker's state.