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:
Nathan Sobo
2013-02-02 15:11:41 -07:00
parent 4a191586db
commit cb6de5b2a4

View File

@@ -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: ->