reduce multiple cursors/selections to the first, original, cursor/selection

This commit is contained in:
Luke Pommersheim 2015-08-31 20:21:43 +02:00
parent 9b719056e0
commit 193fd14e79

View File

@ -2270,11 +2270,11 @@ class TextEditor extends Model
@consolidateSelections()
@getLastSelection().clear(options)
# Reduce multiple selections to the most recently added selection.
# Reduce multiple selections to the first, original selection.
consolidateSelections: ->
selections = @getSelections()
if selections.length > 1
selection.destroy() for selection in selections[0...-1]
selection.destroy() for selection in selections[1...(selections.length)]
true
else
false