From cb6de5b2a44d4e41e144e7a535c07009d6512a81 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 2 Feb 2013 15:11:41 -0700 Subject: [PATCH] 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. --- src/app/selection.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/selection.coffee b/src/app/selection.coffee index 4cd938d3e..09d6f27b6 100644 --- a/src/app/selection.coffee +++ b/src/app/selection.coffee @@ -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: ->