diff --git a/lib/mixins/canvas-drawer.js b/lib/mixins/canvas-drawer.js index d24466f0..2328c426 100644 --- a/lib/mixins/canvas-drawer.js +++ b/lib/mixins/canvas-drawer.js @@ -696,8 +696,8 @@ export default class CanvasDrawer extends Mixin { offscreenRow: range.offscreenRow }) } else if (change.end < range.start || change.start > range.end) { - // The change is outside the range but didn't added - // or removed lines + // The change is outside the range but didn't add + // or remove lines newIntactRanges.push(range) } else { // The change is within the range, there's one intact range @@ -719,6 +719,15 @@ export default class CanvasDrawer extends Mixin { end: range.end + change.screenDelta, offscreenRow: range.offscreenRow + change.end + 1 - range.start }) + } else if (change.screenDelta !== 0) { + // Lines are added or removed in the display buffer, the intact + // range starts in the next line after the change end plus the + // screen delta + newIntactRanges.push({ + start: change.end + change.screenDelta + 1, + end: range.end + change.screenDelta, + offscreenRow: range.offscreenRow + change.end + 1 - range.start + }) } else { // No lines are added, the intact range starts on the line after // the change end