diff --git a/spec/atom/editor-spec.coffee b/spec/atom/editor-spec.coffee index 2914d1f10..bd7cc0d92 100644 --- a/spec/atom/editor-spec.coffee +++ b/spec/atom/editor-spec.coffee @@ -971,6 +971,15 @@ describe "Editor", -> expect(cursor1.getBufferPosition()).toEqual [0,29] expect(cursor2.getBufferPosition()).toEqual [0,59] + describe "when selections are on the same line", -> + it "removes all selected text", -> + editor.setSelectionBufferRange([[0,4], [0,13]]) + editor.addSelectionForBufferRange([[0,16], [0,24]]) + + editor.delete() + + expect(editor.lineForBufferRow(0)).toBe 'var = () {' + describe "keyboard movement", -> it "moves all cursors", -> editor.setCursorScreenPosition([3, 13]) diff --git a/src/atom/composite-selection.coffee b/src/atom/composite-selection.coffee index ee3962c2f..60ca73e9d 100644 --- a/src/atom/composite-selection.coffee +++ b/src/atom/composite-selection.coffee @@ -39,7 +39,7 @@ class CompositeSeleciton selection.backspace() delete: -> - for selection in @getSelections() + @modifySelections (selection) -> selection.delete() selectToScreenPosition: (position) ->