Add startScreenRow and endScreenRow to DisplayBuffer::findMarkers

This commit is contained in:
Ben Ogle & Nathan Sobo
2014-06-12 14:33:14 -06:00
committed by Ben Ogle
parent a7379b067a
commit 56da6399b8
2 changed files with 12 additions and 0 deletions

View File

@@ -912,6 +912,12 @@ describe "DisplayBuffer", ->
expect(displayBuffer.findMarkers(class: 'a', startBufferRow: 0, endBufferRow: 3)).toEqual [marker1]
expect(displayBuffer.findMarkers(endBufferRow: 10)).toEqual [marker3]
it "allows the startScreenRow and endScreenRow to be specified", ->
marker1 = displayBuffer.markBufferRange([[6, 0], [7, 0]], class: 'a')
marker2 = displayBuffer.markBufferRange([[9, 0], [10, 0]], class: 'a')
displayBuffer.createFold(4, 7)
expect(displayBuffer.findMarkers(class: 'a', startScreenRow: 6, endScreenRow: 7)).toEqual [marker2]
describe "marker destruction", ->
it "allows markers to be destroyed", ->
marker = displayBuffer.markScreenRange([[5, 4], [5, 10]])

View File

@@ -912,6 +912,12 @@ class DisplayBuffer extends Model
key = 'startRow'
when 'endBufferRow'
key = 'endRow'
when 'startScreenRow'
key = 'startRow'
value = @bufferRowForScreenRow(value)
when 'endScreenRow'
key = 'endRow'
value = @bufferRowForScreenRow(value)
when 'containsBufferRange'
key = 'containsRange'
when 'containsBufferPosition'