We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4807dac + 30f0b5f commit ad73e17Copy full SHA for ad73e17
src/modules/multi-cursor.coffee
@@ -61,8 +61,12 @@ class MultiCursor extends EventEmitter2
61
62
shiftCursors: (index, length, authorId = null) ->
63
_.each(@cursors, (cursor, id) =>
64
- return unless cursor and (cursor.index > index or cursor.userId == authorId)
65
- cursor.index += Math.max(length, index - cursor.index)
+ return unless cursor
+ shift = Math.max(length, index - cursor.index)
66
+ if cursor.userId == authorId
67
+ this.moveCursor(authorId, cursor.index + shift)
68
+ else if cursor.index > index
69
+ cursor.index += shift
70
)
71
72
update: ->
0 commit comments