y-text
y-text copied to clipboard
Should y-text work with multiple ace EditSession?
When I use
EditSession = ace.require("ace/edit_session").EditSession;
And then setup the sessions I can't get the code sharing between browsers to work. I get this error:
Text.js:277 Uncaught Error: Error: This position exceeds the range of the array!
at n (Text.js:277)
at Array.r (Text.js:285)
at b.r._signal (ace.js:1)
at b.onDocumentChange (ace.js:1)
at p.r._signal (ace.js:1)
at p.onChange (ace.js:1)
at a.r._signal (ace.js:1)
at applyDelta (ace.js:1)
at a.insertMergedLines (ace.js:1)
at a.insert (ace.js:1)
Should yjs work with multiple ace edit sessions?
I'm setting it up as follows:
Y({
db: {
name: 'memory'
},
connector: {
name: 'websockets-client',
room: 'ace-example',
url: 'http://localhost:1234'
},
sourceDir: '/bower_components',
share: {
ace: 'Text' // y.share.textarea is of type Y.Text
}
}).then(function (y) {
editor = ace.edit("editor");
editor.setTheme("ace/theme/chrome");
y.share.ace.bindAce(editor);
EditSession = ace.require("ace/edit_session").EditSession;
/* And then code that sets up all the sessions and calls SetValue to set the initial code */