mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Honor autoscroll option when setting a selection's buffer range
If we pass an explicit autoscroll option when selection, we don't want to autoscroll the cursor. If the option is true, we'll autoscroll to the middle of the selection. If the option is false, we don't want any autoscrolling, including to the cursor. The cursor should only autoscroll when the option is undefined.
This commit is contained in:
@@ -59,6 +59,7 @@ class Selection
|
||||
options.reverse ?= @isReversed()
|
||||
@editSession.destroyFoldsIntersectingBufferRange(bufferRange) unless options.preserveFolds
|
||||
@modifySelection =>
|
||||
@cursor.needsAutoscroll = false if options.autoscroll?
|
||||
@editSession.setMarkerBufferRange(@marker, bufferRange, options)
|
||||
|
||||
getBufferRowRange: ->
|
||||
|
||||
Reference in New Issue
Block a user