Actually, this should be somewhat simple. If one builds a synchronous editor, it should be event-based, isn’t it in your case?
So you should be able to do 2 things: detect an edit (and send it to others) and programmatically change the content of the edit area once you recieve a message (“another guy has edited”). And that’s not difficult to do:
- to detect editing, use the
change
/changes
events - to set changes, use content manipulation methods like
setValue
orreplaceRange
1
solved online collaborative code editing ide