mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
🐛 Always copy selections in order
This commit is contained in:
@@ -2792,6 +2792,20 @@ describe "TextEditor", ->
|
||||
[[5, 8], [5, 8]]
|
||||
])
|
||||
|
||||
describe "when many selections get added in shuffle order", ->
|
||||
it "copies them in order", ->
|
||||
editor.setSelectedBufferRanges([
|
||||
[[2,8], [2, 13]]
|
||||
[[0,4], [0,13]],
|
||||
[[1,6], [1, 10]],
|
||||
])
|
||||
editor.copySelectedText()
|
||||
expect(atom.clipboard.read()).toEqual """
|
||||
quicksort
|
||||
sort
|
||||
items
|
||||
"""
|
||||
|
||||
describe ".pasteText()", ->
|
||||
copyText = (text, {startColumn, textEditor}={}) ->
|
||||
startColumn ?= 0
|
||||
|
||||
@@ -2621,7 +2621,7 @@ class TextEditor extends Model
|
||||
# Essential: For each selection, copy the selected text.
|
||||
copySelectedText: ->
|
||||
maintainClipboard = false
|
||||
for selection in @getSelections()
|
||||
for selection in @getSelectionsOrderedByBufferPosition()
|
||||
if selection.isEmpty()
|
||||
previousRange = selection.getBufferRange()
|
||||
selection.selectLine()
|
||||
|
||||
Reference in New Issue
Block a user