mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Merge pull request #1622 from atom/ns-fix-row-map-corruption
Fix row map corruption
This commit is contained in:
@@ -460,6 +460,12 @@ describe "DisplayBuffer", ->
|
||||
|
||||
expect(changeHandler).toHaveBeenCalledWith(start: 3, end: 3, screenDelta: 1, bufferDelta: 1)
|
||||
|
||||
describe "when the change starts at the beginning of a fold but does not extend to the end (regression)", ->
|
||||
it "preserves a proper mapping between buffer and screen coordinates", ->
|
||||
expect(displayBuffer.screenPositionForBufferPosition([8, 0])).toEqual [4, 0]
|
||||
buffer.setTextInRange([[2, 0], [3, 0]], "\n")
|
||||
expect(displayBuffer.screenPositionForBufferPosition([8, 0])).toEqual [4, 0]
|
||||
|
||||
describe "position translation", ->
|
||||
it "translates positions to account for folded lines and characters and the placeholder", ->
|
||||
fold = displayBuffer.createFold(4, 7)
|
||||
|
||||
@@ -584,6 +584,7 @@ class DisplayBuffer extends Model
|
||||
|
||||
updateScreenLines: (startBufferRow, endBufferRow, bufferDelta=0, options={}) ->
|
||||
startBufferRow = @rowMap.bufferRowRangeForBufferRow(startBufferRow)[0]
|
||||
endBufferRow = @rowMap.bufferRowRangeForBufferRow(endBufferRow - 1)[1]
|
||||
startScreenRow = @rowMap.screenRowRangeForBufferRow(startBufferRow)[0]
|
||||
endScreenRow = @rowMap.screenRowRangeForBufferRow(endBufferRow - 1)[1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user