It represents quite some work:
- where to save the draft
- in which PDS to write if different users
- how long to save the draft
- etc.
I think the easy solution would be to use https://github.com/yjs/yjs with https://github.com/yjs/y-codemirror.next
Might check this as well https://tangled.org/jakelazaroff.com/y-pds