diff --git a/spec/atom/editor-spec.coffee b/spec/atom/editor-spec.coffee index 1a75184bb..e2b71be22 100644 --- a/spec/atom/editor-spec.coffee +++ b/spec/atom/editor-spec.coffee @@ -745,3 +745,9 @@ describe "Editor", -> editor.setCursorScreenPosition([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] + + diff --git a/src/atom/cursor.coffee b/src/atom/cursor.coffee index 2316eee67..2674d5299 100644 --- a/src/atom/cursor.coffee +++ b/src/atom/cursor.coffee @@ -13,7 +13,7 @@ class Cursor extends View @one 'attach', => @updateAppearance() bufferChanged: (e) -> - @setScreenPosition(e.newRange.end) + @setBufferPosition(e.newRange.end) setScreenPosition: (position) -> position = Point.fromObject(position)