I am missing something extraordinarily obvious, I just know it.
I am using Javascript, because I am using Greasemonkey. I want to have a GM script that does the following:
* In a textarea field, I highlight a bit of text.
* I clicky the link. (That I've inserted into the doc via GM, naturally.)
* A prompt comes up, with the highlighted text set as the default.
* I hit OK, so that this script will format the text.
* It replaces the highlighted text with the new text...
* ...and doesn't lose my place.
I can do every other part, but not that last one. I get vague approximations, but they all completely suck. Like scrolling to home, then putting the cursor just after the inserted text. No scrolling, goddammit! Make like Word's Find/Replace thing, all right?
I am not finding this, and I don't know why.
(Note to self:
jQuery + GM?)