diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 94cb70bfb04..ec36b1dd24a 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -768,8 +768,19 @@ describe "Editor", -> expect(selectionView.regions.length).toBe 3 expect(selectionView.find('.selection').length).toBe 3 + describe "when a selection merges with another selection", -> + it "removes the merged selection view", -> + editSession = editor.activeEditSession + editSession.setCursorScreenPosition([4, 10]) + editSession.selectToScreenPosition([5, 27]) + editSession.addCursorAtScreenPosition([3, 10]) + editSession.selectToScreenPosition([6, 27]) + + expect(editor.getSelectionViews().length).toBe 1 + expect(editor.find('.selection').length).toBe 3 + describe "cursor rendering", -> - + describe "when the cursor moves", -> charWidth = null diff --git a/src/app/selection-view.coffee b/src/app/selection-view.coffee index 455b49e69a4..889fcf34c18 100644 --- a/src/app/selection-view.coffee +++ b/src/app/selection-view.coffee @@ -13,7 +13,7 @@ class SelectionView extends View initialize: ({@editor, @selection} = {}) -> @regions = [] @selection.on 'change-screen-range', => @updateAppearance() - @selection.on 'destroy', => @remove('ignore') + @selection.on 'destroy', => @remove() @updateAppearance() updateAppearance: ->