Conversion of variables and functions 0.10 -> 0.12

Looking at the function rebaseSteps, it seems like there are situations when not all unconfirmed steps can be rebased, yet the rebased [1] number is based on the number of unconfirmed steps before trying to rebase steps on top of the incoming steps. So I believe it’s in these situations that tr.docs[tr.steps.length - rebased] comes up with the wrong result for me.

This seems to be working though:

let rebased = tr.getMeta("rebased")
let docNumber = rebased + stepsLength
let confirmedDoc = docNumber === tr.docs.length ?
            tr.doc :
            tr.docs[docNumber]

Where stepsLength is the number of steps as they were received from the server.

This is still a bit complex and new for me, so further tests may show problems with this also.

[1] prosemirror-collab/src/collab.js at 039209c71bc10cdbfaab77f206a2dd07447e1565 · ProseMirror/prosemirror-collab · GitHub