Ace Editor - paste text into position

I am working on a real-time collaboration editor in the Ace editor, and I could not find any documents for inserting text at a specific position in the editor (Aka, the position that another user enters). Any ideas

+5
source share
2 answers

use editor.session.insert(position, text) , where position is an object of the form {row:number, column:number} However, this alone will not help to create a collaborative editor. take a look at share.js which supports Ace.

+12
source

Paste at the current position you can use (assuming this may be what you are looking for)

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

+10
source

All Articles