From e048e1682b71d95e5c40ffb9250f1e0aedd1b36b Mon Sep 17 00:00:00 2001 From: abe33 Date: Thu, 4 Jun 2015 12:58:27 +0200 Subject: [PATCH] :bug: Fix duplicated lines at the end of the minimap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This problem occurs when the only changes are screen lines changes due to soft wrapping (by splitting panes, resizing the window, or just at intialization). In that case, we don’t compute an extra intact range that would copy a part of the offscreen buffer at the wrong place. Fixes #292 --- lib/mixins/canvas-drawer.coffee | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/mixins/canvas-drawer.coffee b/lib/mixins/canvas-drawer.coffee index a3a0410a..126fbe79 100644 --- a/lib/mixins/canvas-drawer.coffee +++ b/lib/mixins/canvas-drawer.coffee @@ -444,11 +444,14 @@ class CanvasDrawer extends Mixin end: change.start - 1 domStart: range.domStart) if change.end < range.end - newIntactRanges.push( - start: change.end + change.screenDelta + 1 - end: range.end + change.screenDelta - domStart: range.domStart + change.end + 1 - range.start - ) + # If the bufferDelta is 0 then it's a change in the screen lines + # due to soft wrapping, we don't need to touch to the intact ranges + unless change.bufferDelta is 0 + newIntactRanges.push( + start: change.end + change.screenDelta + 1 + end: range.end + change.screenDelta + domStart: range.domStart + change.end + 1 - range.start + ) intactRange = newIntactRanges[newIntactRanges.length - 1]