mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Changeset: Migrate from OpIter
to deserializeOps()
This commit is contained in:
parent
0eca0251f2
commit
89fe40e080
16 changed files with 147 additions and 179 deletions
|
@ -162,13 +162,8 @@ const loadBroadcastJS = (socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
|
|||
// some chars are replaced (no attributes change and no length change)
|
||||
// test if there are keep ops at the start of the cs
|
||||
if (lineChanged === undefined) {
|
||||
lineChanged = 0;
|
||||
const opIter = Changeset.opIterator(Changeset.unpack(changeset).ops);
|
||||
|
||||
if (opIter.hasNext()) {
|
||||
const op = opIter.next();
|
||||
if (op.opcode === '=') lineChanged += op.lines;
|
||||
}
|
||||
const [op] = Changeset.deserializeOps(Changeset.unpack(changeset).ops);
|
||||
lineChanged = op != null && op.opcode === '=' ? op.lines : 0;
|
||||
}
|
||||
|
||||
const goToLineNumber = (lineNumber) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue