mirror of
https://github.com/atom/atom.git
synced 2026-02-09 22:24:59 -05:00
x/$/ places cursors at end of lines in current selection
Editor addSelectionForBufferRange no longer attempts to recycle an existing empty selection, because this was interfering with x selecting zero-width matches. It always adds a new selection, and tools must take care to use it correctly.
This commit is contained in:
@@ -15,4 +15,5 @@ class SelectAllMatches extends Command
|
||||
rangesToSelect.push(range)
|
||||
|
||||
editor.clearSelections()
|
||||
editor.addSelectionForBufferRange(range) for range in rangesToSelect
|
||||
editor.setSelectionBufferRange(rangesToSelect[0])
|
||||
editor.addSelectionForBufferRange(range) for range in rangesToSelect[1..]
|
||||
|
||||
@@ -30,12 +30,7 @@ class CompositeSeleciton
|
||||
@editor.lines.append(selection)
|
||||
|
||||
addSelectionForBufferRange: (bufferRange, options) ->
|
||||
selections = @getSelections()
|
||||
cursor = if selections.length == 1 and selections[0].isEmpty()
|
||||
selections[0].cursor
|
||||
else
|
||||
@editor.compositeCursor.addCursor()
|
||||
|
||||
cursor = @editor.compositeCursor.addCursor()
|
||||
@selectionForCursor(cursor).setBufferRange(bufferRange, options)
|
||||
|
||||
removeSelectionForCursor: (cursor) ->
|
||||
|
||||
Reference in New Issue
Block a user