Backspace works with multiple selections

This commit is contained in:
Corey Johnson & Nathan Sobo 2012-03-27 09:06:59 -07:00 committed by Corey Johnson
parent 29a2cc5886
commit 553194dc9e
2 changed files with 3 additions and 3 deletions

View File

@ -916,11 +916,11 @@ describe "Editor", ->
describe "when selections are on the same line", ->
it "removes all selected text", ->
editor.setSelectionBufferRange([[0,4], [0,13]])
editor.addSelectionForBufferRange([[0,22], [0,24]])
editor.addSelectionForBufferRange([[0,16], [0,24]])
editor.backspace()
expect(editor.lineForBufferRow(0)).toBe 'var = functio () {'
expect(editor.lineForBufferRow(0)).toBe 'var = () {'
describe "delete", ->
describe "when cursors are on the same line", ->

View File

@ -35,7 +35,7 @@ class CompositeSeleciton
selection.insertText(text)
backspace: ->
for selection in @getSelections()
@modifySelections (selection) ->
selection.backspace()
delete: ->