I’m trying to get the last node and its position in the document. I just can’t seem to find out how to do it.
I know I can get the last node by: state.doc.lastChild however, how do I get its position?
I’m trying to place the cursor (selection) at the very beginning of that node. However, in order to change the selection, I need a pos.
glad it worked out. you can also use the static method create to directly use the numerical position instead of resolving it. As far as I understand, adding 1 is important if you want to insert at start but still inside the the last node.