Merge master

This commit is contained in:
Garen Torikian
2013-04-10 15:05:21 -05:00
11 changed files with 178 additions and 6 deletions

View File

@@ -2552,3 +2552,14 @@ describe "Editor", ->
runs ->
expect(editor.renderedLines.find('.line').text()).toBe 'hidden changes'
describe "editor:scroll-to-cursor", ->
it "scrolls to and centers the editor on the cursor's position", ->
editor.attachToDom(heightInLines: 3)
editor.setCursorBufferPosition([1, 2])
editor.scrollToBottom()
expect(editor.getFirstVisibleScreenRow()).not.toBe 0
expect(editor.getLastVisibleScreenRow()).not.toBe 2
editor.trigger('editor:scroll-to-cursor')
expect(editor.getFirstVisibleScreenRow()).toBe 0
expect(editor.getLastVisibleScreenRow()).toBe 2