mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Merge pull request #5733 from as-cii/efficient-cursor-merging
🐎 Speed up `mergeCursors`
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user