Compare commits

..

3 Commits

Author SHA1 Message Date
Kevin Jahns
d30bf050bf v13.0.0-37 -- distribution files 2017-12-02 01:46:06 -08:00
Kevin Jahns
cf8698f2b6 13.0.0-37 2017-12-02 01:45:55 -08:00
Kevin Jahns
3595f14da7 fix insert in y-text 2017-12-02 01:45:22 -08:00
7 changed files with 20 additions and 14 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.0.0-32",
"version": "13.0.0-37",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.0.0-36",
"version": "13.0.0-37",
"description": "A framework for real-time p2p shared editing on any data",
"main": "./y.node.js",
"browser": "./y.js",

View File

@@ -29,14 +29,17 @@ export default class YText extends YArray {
let right = this._start
let count = 0
while (right !== null) {
if (count <= pos && pos < count + right._length) {
const rightLen = right._deleted ? 0 : (right._length - 1)
if (count <= pos && pos <= count + rightLen) {
const splitDiff = pos - count
right = right._splitAt(this._y, pos - count)
right = right._splitAt(this._y, splitDiff)
left = right._left
count += splitDiff
break
}
count += right._length
if (!right._deleted) {
count += right._length
}
left = right
right = right._right
}

6
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
/**
* yjs - A framework for real-time p2p shared editing on any data
* @version v13.0.0-36
* @version v13.0.0-37
* @license MIT
*/
@@ -2556,14 +2556,17 @@ class YText extends YArray {
let right = this._start;
let count = 0;
while (right !== null) {
if (count <= pos && pos < count + right._length) {
const rightLen = right._deleted ? 0 : (right._length - 1);
if (count <= pos && pos <= count + rightLen) {
const splitDiff = pos - count;
right = right._splitAt(this._y, pos - count);
right = right._splitAt(this._y, splitDiff);
left = right._left;
count += splitDiff;
break
}
count += right._length;
if (!right._deleted) {
count += right._length;
}
left = right;
right = right._right;
}

File diff suppressed because one or more lines are too long