Use buffer instead of line map for EditSession.clipBufferPosition(position)

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-06-12 16:42:45 -07:00
parent 51905f245a
commit 6c8b2e1a54
4 changed files with 13 additions and 7 deletions

View File

@@ -1234,3 +1234,9 @@ describe "EditSession", ->
editSession.foldAll()
expect(editSession.getCursorBufferPosition()).toEqual([5,5])
describe ".clipBufferPosition(bufferPosition)", ->
it "clips the given position to a valid position", ->
expect(editSession.clipBufferPosition([-1, -1])).toEqual [0,0]
expect(editSession.clipBufferPosition([Infinity, Infinity])).toEqual [12,2]
expect(editSession.clipBufferPosition([8, 57])).toEqual [8, 56]