mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Don't destroy folds that are completely contained within a selection
This commit is contained in:
@@ -2495,8 +2495,9 @@ class TextEditor extends Model
|
||||
#
|
||||
# Returns the added {Selection}.
|
||||
addSelectionForBufferRange: (bufferRange, options={}) ->
|
||||
bufferRange = Range.fromObject(bufferRange)
|
||||
unless options.preserveFolds
|
||||
@destroyFoldsIntersectingBufferRange(bufferRange)
|
||||
@displayLayer.destroyFoldsContainingBufferPositions([bufferRange.start, bufferRange.end])
|
||||
@selectionsMarkerLayer.markBufferRange(bufferRange, {invalidate: 'never', reversed: options.reversed ? false})
|
||||
@getLastSelection().autoscroll() unless options.autoscroll is false
|
||||
@getLastSelection()
|
||||
@@ -3446,6 +3447,10 @@ class TextEditor extends Model
|
||||
destroyFoldsIntersectingBufferRange: (bufferRange) ->
|
||||
@displayLayer.destroyFoldsIntersectingBufferRange(bufferRange)
|
||||
|
||||
# Remove any {Fold}s found that intersect the given array of buffer positions.
|
||||
destroyFoldsContainingBufferPositions: (bufferPositions) ->
|
||||
@displayLayer.destroyFoldsContainingBufferPositions(bufferPositions)
|
||||
|
||||
###
|
||||
Section: Gutters
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user