Add assertion about removing the last selection

This commit is contained in:
Nathan Sobo
2015-07-09 00:23:11 -05:00
parent 442e75853b
commit de8d1d95d8

View File

@@ -2245,6 +2245,7 @@ class TextEditor extends Model
# Remove the given selection.
removeSelection: (selection) ->
_.remove(@selections, selection)
atom.assert @selections.length > 0, "Removed last selection"
@emit 'selection-removed', selection if includeDeprecatedAPIs
@emitter.emit 'did-remove-selection', selection