mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Autoscroll correctly when dragging gutter selections
* Explicitly assign the orientation of the selection when it crosses the initially clicked row. * Autoscroll to the cursor, not the entire selection.
This commit is contained in:
@@ -428,9 +428,10 @@ class TextEditorComponent
|
||||
dragRow = screenPosition.row
|
||||
dragBufferRow = @editor.bufferRowForScreenRow(dragRow)
|
||||
if dragBufferRow < clickedBufferRow # dragging up
|
||||
@editor.setSelectedBufferRange([[dragBufferRow, 0], [clickedBufferRow + 1, 0]], preserveFolds: true)
|
||||
@editor.setSelectedBufferRange([[dragBufferRow, 0], [clickedBufferRow + 1, 0]], reversed: true, preserveFolds: true, autoscroll: false)
|
||||
else
|
||||
@editor.setSelectedBufferRange([[clickedBufferRow, 0], [dragBufferRow + 1, 0]], preserveFolds: true)
|
||||
@editor.setSelectedBufferRange([[clickedBufferRow, 0], [dragBufferRow + 1, 0]], reversed: false, preserveFolds: true, autoscroll: false)
|
||||
@editor.getLastCursor().autoscroll()
|
||||
|
||||
onGutterMetaClick: (event) =>
|
||||
clickedRow = @screenPositionForMouseEvent(event).row
|
||||
|
||||
Reference in New Issue
Block a user