Batch updates when moving cursors

This ensures that updates associated with autoscroll and cursor movement
get combined.
This commit is contained in:
Nathan Sobo
2014-04-15 13:42:54 -06:00
parent 64a487eebb
commit 033db8997b

View File

@@ -1472,7 +1472,8 @@ class Editor extends Model
moveCursors: (fn) ->
@movingCursors = true
fn(cursor) for cursor in @getCursors()
@batchUpdates =>
fn(cursor) for cursor in @getCursors()
@mergeCursors()
@movingCursors = false
@emit 'cursors-moved'