Changes correctly update cursor position when there are folds

This commit is contained in:
Nathan Sobo 2012-02-24 22:08:34 -07:00
parent 0bc510ab58
commit 8e107359f3
2 changed files with 7 additions and 1 deletions

View File

@ -745,3 +745,9 @@ describe "Editor", ->
editor.setCursorScreenPosition([9, 2]) editor.setCursorScreenPosition([9, 2])
expect(editor.getCursorScreenPosition()).toEqual [9, 2] expect(editor.getCursorScreenPosition()).toEqual [9, 2]
buffer.insert([9, 4], 'x')
expect(editor.getCursorScreenPosition()).toEqual [6, 5]
expect(editor.getCursorBufferPosition()).toEqual [9, 5]

View File

@ -13,7 +13,7 @@ class Cursor extends View
@one 'attach', => @updateAppearance() @one 'attach', => @updateAppearance()
bufferChanged: (e) -> bufferChanged: (e) ->
@setScreenPosition(e.newRange.end) @setBufferPosition(e.newRange.end)
setScreenPosition: (position) -> setScreenPosition: (position) ->
position = Point.fromObject(position) position = Point.fromObject(position)