mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Defer merging likewise gutter selections until mouseup
This commit is contained in:
@@ -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]]]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user