fix offset in state vector
This commit is contained in:
parent
4a7d6f0a2d
commit
4d12a02e2f
@ -85,7 +85,7 @@ export default [{
|
|||||||
// commonjs()
|
// commonjs()
|
||||||
]
|
]
|
||||||
}, {
|
}, {
|
||||||
input: ['./examples/textarea.js', './examples/prosemirror.js'], // './examples/quill.js', './examples/dom.js', './examples/codemirror.js'
|
input: ['./examples/prosemirror.js'], // './examples/textarea.js', './examples/quill.js', './examples/dom.js', './examples/codemirror.js'
|
||||||
output: {
|
output: {
|
||||||
dir: 'examples/build',
|
dir: 'examples/build',
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
|
@ -401,9 +401,10 @@ export const decodeStateVector = decodedState => readStateVector(decoding.create
|
|||||||
export const writeDocumentStateVector = (encoder, doc) => {
|
export const writeDocumentStateVector = (encoder, doc) => {
|
||||||
encoding.writeVarUint(encoder, doc.store.clients.size)
|
encoding.writeVarUint(encoder, doc.store.clients.size)
|
||||||
doc.store.clients.forEach((structs, client) => {
|
doc.store.clients.forEach((structs, client) => {
|
||||||
const id = structs[structs.length - 1].id
|
const struct = structs[structs.length - 1]
|
||||||
|
const id = struct.id
|
||||||
encoding.writeVarUint(encoder, id.client)
|
encoding.writeVarUint(encoder, id.client)
|
||||||
encoding.writeVarUint(encoder, id.clock)
|
encoding.writeVarUint(encoder, id.clock + struct.length)
|
||||||
})
|
})
|
||||||
return encoder
|
return encoder
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user