WIP: Converting to operations, but substitution operations need anchor ranges

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-07-13 18:30:10 -06:00
parent 926067164d
commit fd24b82d47
7 changed files with 42 additions and 32 deletions

View File

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