Skip to content

Commit

Permalink
🐛 Fix duplicated lines at the end of the minimap
Browse files Browse the repository at this point in the history
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
  • Loading branch information
abe33 committed Jun 4, 2015
1 parent 69d45dd commit e048e16
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/mixins/canvas-drawer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit e048e16

Please sign in to comment.