diff --git a/lib/mixins/canvas-drawer.coffee b/lib/mixins/canvas-drawer.coffee index e9bd2192..80226672 100644 --- a/lib/mixins/canvas-drawer.coffee +++ b/lib/mixins/canvas-drawer.coffee @@ -423,9 +423,6 @@ class CanvasDrawer extends Mixin for change in @pendingChanges newIntactRanges = [] for range in intactRanges - if isNaN(change.screenDelta) - change.screenDelta = change.end - change.start - if change.end < range.start and change.screenDelta != 0 newIntactRanges.push( start: range.start + change.screenDelta diff --git a/lib/mixins/decoration-management.coffee b/lib/mixins/decoration-management.coffee index eb767bc0..8c814c3a 100644 --- a/lib/mixins/decoration-management.coffee +++ b/lib/mixins/decoration-management.coffee @@ -198,7 +198,7 @@ class DecorationManagement extends Mixin [start, end] = [end, start] if start.row > end.row - @emitRangeChanges({start, end, screenDelta: end - start}) + @emitRangeChanges({start, end}) decoration = new Decoration(marker, this, decorationParams) @decorationsByMarkerId[marker.id] ?= [] @@ -229,14 +229,12 @@ class DecorationManagement extends Mixin # Internal: Emits a change for the specified range. # # range - The `Range` to emits changes for. - emitRangeChanges: (range) -> + emitRangeChanges: (range, screenDelta) -> startScreenRow = range.start.row endScreenRow = range.end.row lastRenderedScreenRow = @getLastVisibleScreenRow() firstRenderedScreenRow = @getFirstVisibleScreenRow() - screenDelta = (lastRenderedScreenRow - firstRenderedScreenRow) - (endScreenRow - startScreenRow) - - screenDelta = 0 if isNaN(screenDelta) + screenDelta ?= (lastRenderedScreenRow - firstRenderedScreenRow) - (endScreenRow - startScreenRow) changeEvent = start: startScreenRow