Ace editor - insert text at position

Jake Cross picture Jake Cross · May 1, 2015 · Viewed 7.1k times · Source

I'm working on a real-time collaborative editor within Ace editor, and I couldn't find any docs on inserting text at a certain position within the editor (Aka, the position the other user types at.) Any ideas?

Answer

Sooraj picture Sooraj · Mar 14, 2017

To insert at current position you can use ( assuming that might be what you are looking for )

editor.session.insert(editor.getCursorPosition(), text)