mirror of
https://github.com/atom/atom.git
synced 2026-02-13 16:14:59 -05:00
Add assertion about removing the last selection
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user