mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🎨 Rename to TextEditor#mergeSelectionsOnSameRows
* 🔥 Delete `Selection#intersectsByRowWith`
This commit is contained in:
@@ -162,18 +162,6 @@ class Selection extends Model
|
||||
intersectsScreenRow: (screenRow) ->
|
||||
@getScreenRange().intersectsRow(screenRow)
|
||||
|
||||
# Public: Identifies if this selection's rows intersects with another selection's rows.
|
||||
#
|
||||
# * `otherSelection` A {Selection} to check against.
|
||||
#
|
||||
# Returns a {Boolean}
|
||||
intersectsByRowWith: (otherSelection) ->
|
||||
otherScreenRange = otherSelection.getScreenRange()
|
||||
|
||||
@getScreenRange().intersectsRowRange(
|
||||
otherScreenRange.start.row, otherScreenRange.end.row
|
||||
)
|
||||
|
||||
# Public: Identifies if a selection intersects with another selection.
|
||||
#
|
||||
# * `otherSelection` A {Selection} to check against.
|
||||
|
||||
@@ -1026,7 +1026,7 @@ class TextEditor extends Model
|
||||
|
||||
# Extended: Delete all lines intersecting selections.
|
||||
deleteLine: ->
|
||||
@mergeIntersectingSelectionsByRow()
|
||||
@mergeSelectionsOnSameRows()
|
||||
@mutateSelectedText (selection) -> selection.deleteLine()
|
||||
|
||||
###
|
||||
@@ -2054,9 +2054,9 @@ class TextEditor extends Model
|
||||
|
||||
previousSelection.intersectsWith(currentSelection, exclusive)
|
||||
|
||||
mergeIntersectingSelectionsByRow: (args...) ->
|
||||
mergeSelectionsOnSameRows: (args...) ->
|
||||
@mergeSelections args..., (previousSelection, currentSelection) ->
|
||||
previousSelection.intersectsByRowWith(currentSelection)
|
||||
previousSelection.intersectsScreenRowRange(currentSelection.getBufferRowRange()...)
|
||||
|
||||
mergeSelections: (args...) ->
|
||||
mergePredicate = args.pop()
|
||||
|
||||
Reference in New Issue
Block a user