mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user