Skip to content

Should y-text work with multiple ace EditSession? #10

Description

@davidmball

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 */

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions