diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index e12ee2660..a9dd255d8 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -1964,10 +1964,12 @@ describe "TextEditorComponent", -> gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(6), metaKey: true)) expect(editor.getSelectedScreenRanges()).toEqual [[[3, 0], [3, 2]], [[4, 0], [7, 0]]] - it "merges overlapping selections", -> + it "merges overlapping selections when the mouse button is released", -> gutterNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenRowInGutter(2), metaKey: true)) gutterNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenRowInGutter(6), metaKey: true)) nextAnimationFrame() + expect(editor.getSelectedScreenRanges()).toEqual [[[3, 0], [3, 2]], [[2, 0], [7, 0]]] + gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(6), metaKey: true)) expect(editor.getSelectedScreenRanges()).toEqual [[[2, 0], [7, 0]]] diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index e070afd29..e526df22f 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -448,9 +448,6 @@ class TextEditorComponent else rowSelection.setBufferRange([[clickedBufferRow, 0], [dragBufferRow + 1, 0]], preserveFolds: true) - # After updating the selected screen range, merge overlapping selections - @editor.mergeIntersectingSelections(preserveFolds: true) - # The merge process will possibly destroy the current selection because # it will be merged into another one. Therefore, we need to obtain a # reference to the new selection that contains the originally selected row