diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 152a70ab0..2f7b4de39 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -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