Merge pull request #5733 from as-cii/efficient-cursor-merging

🐎 Speed up `mergeCursors`
This commit is contained in:
Nathan Sobo
2015-02-25 11:19:55 -07:00

View File

@@ -1797,13 +1797,13 @@ class TextEditor extends Model
# Merge cursors that have the same screen position
mergeCursors: ->
positions = []
positions = {}
for cursor in @getCursors()
position = cursor.getBufferPosition().toString()
if position in positions
if positions.hasOwnProperty(position)
cursor.destroy()
else
positions.push(position)
positions[position] = true
preserveCursorPositionOnBufferReload: ->
cursorPosition = null