mirror of
https://github.com/atom/atom.git
synced 2026-02-09 22:24:59 -05:00
WIP: Converting to operations, but substitution operations need anchor ranges
This commit is contained in:
@@ -302,13 +302,14 @@ class EditSession
|
||||
|
||||
addSelectionForBufferRange: (bufferRange, options) ->
|
||||
@addCursor().selection.setBufferRange(bufferRange, options)
|
||||
@mergeIntersectingSelections()
|
||||
|
||||
setSelectedBufferRange: (bufferRange, options) ->
|
||||
@setSelectedBufferRanges([bufferRange], options)
|
||||
|
||||
setSelectedBufferRanges: (bufferRanges, options={}) ->
|
||||
throw new Error("Passed an empty array to setSelectedBufferRanges") unless bufferRanges.length
|
||||
selection.destroy() for selection in @getSelections()
|
||||
@clearAllSelections()
|
||||
for bufferRange, i in bufferRanges
|
||||
bufferRange = Range.fromObject(bufferRange)
|
||||
unless options.preserveFolds
|
||||
@@ -326,6 +327,9 @@ class EditSession
|
||||
selection.destroy()
|
||||
lastSelection.clear()
|
||||
|
||||
clearAllSelections: ->
|
||||
selection.destroy() for selection in @getSelections()
|
||||
|
||||
getSelections: -> new Array(@selections...)
|
||||
|
||||
getSelection: (index) ->
|
||||
|
||||
Reference in New Issue
Block a user