Skip to content

Commit ad73e17

Browse files
committed
Merge branch 'voxmedia-multi-cursor-show-flag-on-shift' into develop
2 parents 4807dac + 30f0b5f commit ad73e17

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/modules/multi-cursor.coffee

+6-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ class MultiCursor extends EventEmitter2
6161

6262
shiftCursors: (index, length, authorId = null) ->
6363
_.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)
64+
return unless cursor
65+
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
6670
)
6771

6872
update: ->

0 commit comments

Comments
 (0)