Multi-cursor scrolling is based on the last created cursor

This commit is contained in:
Corey Johnson
2012-04-03 16:34:01 -07:00
parent d016cc27d3
commit 2465372bd4
3 changed files with 3 additions and 7 deletions

View File

@@ -136,5 +136,5 @@ class Cursor extends View
position = @editor.pixelPositionForScreenPosition(screenPosition)
@css(position)
if @editor.getCursors().length == 1 or @editor.screenPositionInBounds(screenPosition)
if this == _.last(@editor.getCursors())
@editor.scrollTo(position)

View File

@@ -37,7 +37,6 @@ class Editor extends View
autoIndent: null
lineCache: null
isFocused: false
isScrolling: false
initialize: ({buffer}) ->
requireStylesheet 'editor.css'
@@ -481,10 +480,7 @@ class Editor extends View
@buffer.getMode()
scrollTo: (position) ->
return if @isScrolling
@isScrolling = true
_.defer =>
@isScrolling = false
@scrollVertically(position)
@scrollHorizontally(position)