I realize this might be a dumb question, but somebody once said there is no such thing, so here goes.
I've searched through the posts here, the docs on the site, and even looked around in the source code, but for the life of me, I can't figure out the right way to deal with positions. Thanks to my latest post, I now get how useful ReselvedPos is, but you first need a context for that, perhaps a selection or a transaction, to deal with that.
I'm sure there's an "easy" (read, intended use) to do this, but I just can't seem to reason right about it.To be specific, as I said in my last post, I'm building an editor. I'm currently implementing a custom spellchecking solution, and given the problems highlighted in this forum and on github, I've decided to go about it a little differently. So, I get all the misspelled words in the document, but from another process. That means the offsets are off, and so when I try to "decorate" the misspelled words, I get the wrong ones (except for the first paragraph, which makes sense, since I suppose it's a matter of dealing with paragraph breaks.
I guess, my question is, is there a consistently reliable way to map external positions (offsets from the same exact file) to PM positions?