fix user selection issues

This commit is contained in:
Kevin Jahns
2017-11-28 17:32:51 -08:00
parent b7dbcf69d3
commit b35092928e
3 changed files with 59 additions and 7 deletions

View File

@@ -7,13 +7,13 @@ export function getRelativePosition (type, offset) {
} else {
let t = type._start
while (t !== null) {
if (t._length >= offset) {
return [t._id.user, t._id.clock + offset - 1]
}
if (t._right === null) {
return [t._id.user, t._id.clock + t._length - 1]
}
if (!t._deleted) {
if (t._deleted === false) {
if (t._length >= offset) {
return [t._id.user, t._id.clock + offset - 1]
}
if (t._right === null) {
return [t._id.user, t._id.clock + t._length - 1]
}
offset -= t._length
}
t = t._right