On the one hand I want to be able to play with the editor in the editor. On the other, I want to be able to roll back changes when I break the editor!
If the editor is an enhanced textarea then fall back is easy enough, add a query param to say either don't include JS, or load a specific version, but I'm not sure that textarea can give me enough control.
What do I want from an editor? Auto indent! Maybe vim controls. Indent looks fairly easy ("on a enter keystroke check how many spaces are at the start of the current line, and insert those"). Vim (modal) controls is probably going to be a grind more than anything else - each motion will be differently complicated, and same for verbs, but not that bad so long as I keep the two nice and sperate.
I wonder how hard it will be to get the cursor position in terms of character row/column.
Alright. First job is to get cursor movement working, then mode switch to insert, then delete.