Remove getSelectionAtIndex

We’re going to eventually get rid of the clone in 
getSelections / getCursors freeze those properties 
and return them directly. Then they can operate 
on the list garbage free.
This commit is contained in:
Ben Ogle
2014-08-28 18:16:33 -07:00
parent 9c53d6f014
commit 08388d87c0
3 changed files with 5 additions and 14 deletions

View File

@@ -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")