How to get mapping for only some of a Transaction's steps?

Is there a way to use something like but for only some of that transaction’s steps?

I have a position that I reference mid-way through applying transforms like so:

let tr = … ) // first insert

let positionICareAbout = … // the position I’ll want to map, relative to tr.doc at this point

tr = … ).delete( … ) // more inserting and deleting

let finalPositionICareAbout = // doesn’t give result I need doesn’t work here because it’ll map “first insert,” which I don’t want because I’m referencing a document state in which it was already applied. I just want do map against the steps “after” it. What’s the best way to do this?

1 Like

Yes, there is, see Mapping.slice.

1 Like