diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index 00793dbf2..4d874eb0a 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -814,8 +814,8 @@ describe "EditorComponent", -> it "does not render empty selections", -> editor.addSelectionForBufferRange([[2, 2], [2, 2]]) nextAnimationFrame() - expect(editor.getSelectionAtIndex(0).isEmpty()).toBe true - expect(editor.getSelectionAtIndex(1).isEmpty()).toBe true + expect(editor.getSelections()[0].isEmpty()).toBe true + expect(editor.getSelections()[1].isEmpty()).toBe true expect(componentNode.querySelectorAll('.selection').length).toBe 0 diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index fa59c59b0..fae2bf1fc 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -30,7 +30,7 @@ describe "Editor", -> expect(editor2.id).toBe editor.id expect(editor2.getBuffer().getPath()).toBe editor.getBuffer().getPath() expect(editor2.getSelectedBufferRanges()).toEqual [[[1, 2], [3, 4]], [[5, 6], [7, 5]]] - expect(editor2.getSelectionAtIndex(1).isReversed()).toBeTruthy() + expect(editor2.getSelections()[1].isReversed()).toBeTruthy() expect(editor2.isFoldedAtBufferRow(4)).toBeTruthy() editor2.destroy() @@ -88,7 +88,7 @@ describe "Editor", -> editor2 = editor.copy() expect(editor2.id).not.toBe editor.id expect(editor2.getSelectedBufferRanges()).toEqual editor.getSelectedBufferRanges() - expect(editor2.getSelectionAtIndex(1).isReversed()).toBeTruthy() + expect(editor2.getSelections()[1].isReversed()).toBeTruthy() expect(editor2.isFoldedAtBufferRow(4)).toBeTruthy() # editor2 can now diverge from its origin edit session diff --git a/src/editor.coffee b/src/editor.coffee index 1b50cbf0e..9d3ba15f6 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -2083,19 +2083,10 @@ class Editor extends Model getLastSelection: -> _.last(@selections) - # Extended: Gets the selection at the given index. - # - # * `index` The index of the selection to return, based on the order in which - # the selections were added. - # - # Returns a {Selection}. - getSelectionAtIndex: (index) -> - @selections[index] - # Deprecated: getSelection: (index) -> if index? - deprecate("Use Editor::getSelectionAtIndex(index) instead when getting a specific selection at an index") + deprecate("Use Editor::getSelections()[index] instead when getting a specific selection") @getSelectionAtIndex(index) else deprecate("Use Editor::getLastSelection() instead")